> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# events • AI Agent SDK

> events: Return all journal events for ``run_id`` ordered by ``(seq, kind)``.

# events

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**RunJournal**](../classes/RunJournal) class in the [**journal**](../modules/journal) module.

Return all journal events for `run_id` ordered by `(seq, kind)`.

Ordering by `(seq, rowid)` preserves append order within a step so a
`tool_call` always precedes its `tool_result`.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def events(run_id: str) -> List[JournalEvent]
```

## Parameters

<ParamField query="run_id" type="str" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="List[JournalEvent]">
  The result of the operation.
</ResponseField>

## Uses

* `fetchall`
* `execute`
* `json.loads`
* `JournalEvent`

## Used By

* [`RunJournal.replay_index`](../functions/RunJournal-replay_index)
* [`RunJournal.last_iteration`](../functions/RunJournal-last_iteration)
* [`RunJournal.assert_replay_order`](../functions/RunJournal-assert_replay_order)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/runtime/journal.py#L333">
  `praisonaiagents/runtime/journal.py` at line 333
</Card>
