# Cognee Improve Sessions

Use when working with cognee's session memory or improve(), storing conversation...

- Repository: https://github.com/topoteretes/cognee (32985 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add topoteretes/cognee --skill cognee-improve-sessions -g -a claude-code -y`
Codex: `npx skills add topoteretes/cognee --skill cognee-improve-sessions -g -a codex -y`
Cursor: `npx skills add topoteretes/cognee --skill cognee-improve-sessions -g -a cursor -y`
Gemini CLI: `npx skills add topoteretes/cognee --skill cognee-improve-sessions -g -a gemini-cli -y`

## Description

Use when working with cognee's session memory or improve(), storing conversation turns, agent traces and feedback with session_id, bridging sessions into the permanent graph, reading an ImproveResult, understanding why an improve stage was skipped or already_completed, or tuning the IMPROVE_* settings.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Session memory and improve()

cognee has two kinds of memory:

- **Session memory**: a fast cache of conversation turns, agent traces, and
  feedback, keyed by `session_id`. Writing is instant, with no LLM
  extraction.
- **The permanent graph**: what `remember()` builds without a session.

`improve()` connects them. It bridges session content into the graph and
enriches the graph itself. `remember()` calls it automatically, so most
users never call it directly.

```python
import cognee

# Session write: returns immediately; improve() bridges it in the background
await cognee.remember("User prefers dark mode.", session_id="chat_1")

# Session-aware query: session cache first, then the graph
results = await cognee.recall("What does the user prefer?", session_id="chat_1")

# Bridge sessions into a dataset's graph explicitly
result = await cognee.improve(dataset="main_dataset", session_ids=["chat_1"])
print(result.status, result.stage_summary())

await cognee.wait_for_background_tasks()  # before a script exits
```

## Use it

### Writing session memory

The rest: https://github.com/topoteretes/cognee/blob/HEAD/.agents/skills/cognee-improve-sessions/SKILL.md
