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

# Sessions

> Monitor agent runs that read and wrote to your Cognee memory

The Sessions page (route `/sessions`, under the **DATA** section of the sidebar) lists agent runs that read or wrote to your tenant's Cognee memory. Each session captures the observations, tool calls, tokens, and cost for one agent conversation. This page replaces the older combined **Activity** page.

The header shows a one-line summary of the selected time range — for example, *Agent runs that wrote to your memory · 142 sessions · 96% success · \$3.21*. Aggregate stats (total sessions, success rate, and total spend in USD to two decimals) are pulled from **`GET /v1/sessions/stats?range=`**, and the list itself comes from **`GET /v1/sessions`** (paged).

## Time range

A segmented control in the header filters sessions and stats by time range:

| Range   | Window                 |
| ------- | ---------------------- |
| **24h** | Last 24 hours          |
| **7d**  | Last 7 days            |
| **30d** | Last 30 days (default) |
| **all** | All sessions           |

Click **Refresh** to re-pull the list, the aggregate stats, and the currently open session detail.

## Sessions list

The page uses a two-pane layout. The left pane lists up to 100 sessions; the right pane shows the detail for the selected session.

Each row in the list shows:

* A colored **status dot** indicating the run state.
* A short **session id**.
* The **last-activity** or started date.
* The **model** used.

Status values and their colors:

| Status      | Color  |
| ----------- | ------ |
| `completed` | Green  |
| `running`   | Purple |
| `failed`    | Red    |
| `abandoned` | Gray   |

## Session detail

Selecting a row loads the session from **`GET /v1/sessions/{session_id}`** into the right pane, which opens with a set of stat cards:

* **Observations** — Message count for the session.
* **Tool calls** — Number of tool invocations.
* **Tokens** — Tokens in plus tokens out.
* **Cost** — Spend in USD to four decimals (e.g. `$0.0123`).
* **Duration** — Total run time.

## Transcript

Below the stat cards, the transcript lists the session's question-and-answer turns. Each turn is tagged either **Recall** (purple) or **Remember** (green):

* A turn is **Recall** when its question matches a recall trace — the agent read from memory.
* Otherwise the turn is a **Remember** — the agent wrote to memory.

Click a turn to expand it and reveal the answer, and use the copy-answer button to copy it. Each turn has feedback thumbs (positive or negative) and an optional feedback text field. When a session has more than two turns, an in-transcript search appears so you can filter turns.

**Improve** (graph-enrichment) runs are interleaved into the transcript in chronological order, tagged **Improve** (purple), with a truthful status: **success**, **failed**, or **in progress**. A failed run reads *Graph enrichment did not complete — no memory was bridged this run* and shows its failure reason when one is available. Improve entries are hidden while you are searching the transcript.

## Self-improvement

A **Self-improvement** card at the top of the session detail surfaces the session-to-graph bridge — the visible signal of Cognee's [improve()](/core-concepts/main-operations/improve) operation. As a session accumulates turns or goes idle, Cognee automatically runs `improve()`: the session's questions, answers, and feedback are bridged into the permanent knowledge graph — weighting existing memories by feedback, persisting the conversation, distilling reusable lessons, and enriching the graph so future sessions recall from it.

The card shows the status of the **last graph enrichment** (with a colored status dot, plus **in progress** or **failed** labels). Before any run has happened it reads *No graph enrichment yet. Improve runs automatically once this session accumulates turns or goes idle.*

## Tool invocations and recent activity

A **Tool invocations** bar chart counts traces by function, so you can see which tools the agent used most. A **Recent activity** feed lists the latest traces, each with a green or red status dot, the function name, and either feedback or an error message.

## How sessions get populated

Sessions appear when an agent calls **`POST /v1/recall`** (reads) and **`POST /v1/remember/entry`** (writes) with a consistent `session_id`.

<Tip>
  Use a session id of the form *agent name + a unix timestamp*, and reuse it across the whole conversation so every recall and remember call lands in the same session.
</Tip>

```python theme={null}
session_id = f"support-agent-{int(time.time())}"

# read from memory
recall(session_id=session_id, query="What did the customer order?")

# write to memory
remember_entry(session_id=session_id, content="Customer requested a refund.")
```

Chat sessions created from the in-app [Search](/cognee-cloud/ui/search) page carry the prefix `search-ui-`, so they are easy to distinguish from agent sessions in the list.

## Empty state

When no sessions exist for the selected range, the page shows:

> When an agent connects to Cognee and reads or writes memory, its session will appear here with tools used, observations, and cost.

To start sending data, connect an agent through the [Integrations](/cognee-cloud/ui/integrations) flow, which deep-links back here with a **Go to Sessions →** button.

<Note>
  Looking for chat conversations instead of agent runs? See the [Search](/cognee-cloud/ui/search) page, whose sessions carry the `search-ui-` prefix.
</Note>
