
Session memory and improve()
Explains and operates cognee's session memory and the improve() pipeline that bridges it into the graph
- Repository
- topoteretes/cognee
- Stars
- 33,002
- Licence
- Apache-2.0
- Files
- 1 file
What it does
This skill teaches an AI agent how cognee, an open-source memory library, stores short-term conversation turns, agent traces and feedback in a session cache keyed by session_id, and how improve() later turns that content into a permanent knowledge graph. With it installed, the agent can write and read session memory correctly, choose the right remember()/recall() calls, run improve() in the right order, and explain the nine-stage result, including why a stage was skipped or locked.
Great for
- Developers building agents or chatbots on cognee who need session-aware memory
- Engineers debugging why an improve() run skipped a stage or reported lock_held
- Teams tuning IMPROVE_* settings for their cognee deployment
Skip it if
- People who only want general-purpose cognee setup or basic add/cognify usage, since this covers only sessions and improve()
- Anyone expecting it to change how the agent uses unrelated tools, because it only documents the cognee API and its config
Try asking
- “Store this chat turn in session chat_1 and then bridge that session into the main_dataset graph with improve()”
- “Why did my improve() run report already_completed or lock_held for stage distill_sessions?”
- “Set up feedback with add_feedback on an answer from session abc and explain how it affects graph weights”
- “Which IMPROVE_* settings do I need so review_conflicts and the global context index actually run?”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.
cognee-improve-sessions.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip cognee-improve-sessions.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip cognee-improve-sessions.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Call await cognee.wait_for_background_tasks() before a script exits, or background improve() work may be lost
- Pass explicit session_ids to improve(); stages 1-7 do nothing without them
- Enable PERSONALIZATION_ENABLED, AUTO_FEEDBACK and the opt-in flags only when you need those stages, since they cost LLM calls
What's inside
- SKILL.md
Redistributed unmodified from topoteretes/cognee under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.