An Agent Zero community plugin that integrates Cognee, an open-source AI memory platform combining vector search with graph databases, into Agent Zero's memory lifecycle.
Plugin Name: a0_cognee (underscore) | GitHub: https://github.com/neurocis/a0_cognee | Version: 1.0.0 | License: MIT
Cognee transforms raw conversation data into a connected knowledge graph. This plugin automatically:
- Retains — Extracts key knowledge from conversations and stores it in Cognee
- Recalls — Enriches agent responses with semantic and graph-based search results
- Contextualizes — Injects relevant knowledge graph context into the system prompt
Unlike simple vector-only memory, Cognee links documents, entities, and concepts into a graph structure, enabling relationship-aware retrieval with 14+ search strategies.
Agent Zero Cognee Server (Docker)
├─ monologue_start ┌──────────────────────┐
│ └─ _20_cognee_init │ REST API :8000 │
├─ system_prompt │ ├─ /api/add │
│ └─ _30_cognee_context ────────► │ ├─ /api/cognify │
├─ message_loop_prompts_after │ ├─ /api/search │
│ └─ _51_cognee_recall ────────► │ └─ /api/v1/datasets │
├─ monologue_end │ │
│ └─ _52_cognee_retain ────────► │ Triple Store: │
└─ │ ├─ Relational (meta)│
│ ├─ Vector (semantic)│
│ └─ Graph (relations)│
└──────────────────────┘
| Hook | Extension | Priority | Purpose |
|---|---|---|---|
monologue_start |
_20_cognee_init |
20 | Initialize client state, verify configuration |
system_prompt |
_30_cognee_context |
30 | Query knowledge graph, inject context into system prompt |
message_loop_prompts_after |
_51_cognee_recall |
51 | Search Cognee with user message, inject results as extras |
monologue_end |
_52_cognee_retain |
52 | Extract knowledge via utility LLM, store in Cognee (background) |
- Agent Zero v0.9.x or later
- Cognee Server running and accessible (Docker recommended)
# Quick start with Docker
echo 'LLM_API_KEY="your_openai_key"' > .env
docker run --env-file ./.env -p 8000:8000 --rm -it cognee/cognee:main
# Or with Docker Compose
git clone https://github.com/topoteretes/cognee.git
cd cognee && cp .env.template .env
# Edit .env with your LLM_API_KEY and other settings
docker-compose up -dVerify it's running:
curl http://localhost:8000/api/health
# {"status": "healthy"}-
Clone the plugin into your Agent Zero plugins directory:
cd /path/to/agent-zero/usr/plugins/ git clone https://github.com/neurocis/a0_cognee.git cogneeNote: The plugin is named
a0_cogneein the community index (underscore format for CI compliance), but Agent Zero installs it locally ascognee(without the prefix). -
Enable the plugin in Settings → Plugins.
-
Configure your Cognee server:
- Required: Set
Cognee Base URLin Settings → Cognee Knowledge Memory (e.g.,http://your-cognee-host:8000) - Optional: Set
COGNEE_API_KEYin Settings → Secrets (for authenticated instances)
- Required: Set
Once available in the Plugin Hub, install directly from Settings → Plugins.
All settings are configurable via the plugin's WebUI panel (Settings → Plugins → Cognee Knowledge Memory).
| Setting | Type | Default | Description |
|---|---|---|---|
Cognee Base URL |
text | http://localhost:8000 |
Base URL of your Cognee API server |
| Dataset Prefix | string | a0 |
Combined with project name for dataset isolation |
| Enable Retain | bool | true |
Auto-extract and store conversation knowledge |
| Enable Recall | bool | true |
Enrich responses with graph search results |
| Enable Context | bool | true |
Inject knowledge context into system prompt |
| Auto-Cognify | bool | true |
Build knowledge graph after each retain |
| Search Type | enum | GRAPH_COMPLETION |
Cognee search strategy (see below) |
| Recall Max Tokens | int | 4096 |
Max tokens from recall search results |
| Context Max Tokens | int | 500 |
Max tokens for system prompt context |
| Cache TTL | int | 120 |
Seconds to cache search results |
| Debug Logging | bool | false |
Verbose logging for troubleshooting |
| Search Type | Description | LLM Generation |
|---|---|---|
GRAPH_COMPLETION |
Graph-aware Q&A via vector hints + graph traversal (default) | Yes |
RAG_COMPLETION |
Standard RAG — vector chunks → LLM | Yes |
GRAPH_COMPLETION_COT |
Chain-of-thought iterative graph reasoning | Yes |
GRAPH_SUMMARY_COMPLETION |
Graph context + summaries → LLM | Yes |
TRIPLET_COMPLETION |
Triplet vector search → LLM | Yes |
CHUNKS |
Raw text chunks by vector similarity | No |
SUMMARIES |
Chunk summaries by vector similarity | No |
FEELING_LUCKY |
LLM auto-selects best search type | Varies |
At the end of each agent monologue:
- The conversation history is sent to a utility LLM with an extraction prompt
- Key facts, relationships, and knowledge are extracted as structured data
- The extracted knowledge is sent to Cognee via
POST /api/add - If Auto-Cognify is enabled,
POST /api/cognifybuilds the knowledge graph - All retention runs in a background thread to avoid blocking responses
During each message loop iteration:
- The user's message is used as a search query
- Cognee is queried with the configured search type
- Results are formatted and injected into
loop_data.extras_persistent - The agent sees these results as additional context when generating responses
When the system prompt is assembled:
- Recent conversation history is used as a contextual query
- Cognee returns relevant knowledge graph connections
- Results are injected into the system prompt via the
cognee.context.mdtemplate
Datasets are automatically scoped per project:
- Pattern:
{prefix}-{project_name}(e.g.,a0-myproject) - Default dataset:
a0-defaultwhen no project is active - Change the prefix in plugin settings to create separate knowledge spaces
The plugin includes a companion SKILL.md that can be loaded via skills_tool:load cognee for on-demand CLI access to Cognee operations (search, add data, manage datasets, etc.).
cognee/
├── plugin.yaml # Plugin manifest
├── default_config.yaml # Default settings
├── requirements.txt # Dependencies (aiohttp)
├── hooks.py # install() + pre_update()
├── execute.py # Health check / setup verification
├── README.md # This file
├── SKILL.md # Companion skill for CLI access
├── helpers/
│ ├── __init__.py
│ └── cognee_helper.py # Core REST API integration (~500 lines)
├── extensions/
│ └── python/
│ ├── monologue_start/
│ │ └── _20_cognee_init.py
│ ├── system_prompt/
│ │ └── _30_cognee_context.py
│ ├── message_loop_prompts_after/
│ │ └── _51_cognee_recall.py
│ └── monologue_end/
│ └── _52_cognee_retain.py
├── prompts/
│ ├── cognee.context.md # Context injection template
│ ├── cognee.recall.md # Recall injection template
│ └── cognee.retain_extract.sys.md # LLM extraction system prompt
└── webui/
└── config.html # Settings panel (Alpine.js)
- Verify
COGNEE_BASE_URLis set in Settings → Secrets - Check Cognee server is reachable:
curl $COGNEE_BASE_URL/api/health - Enable Debug Logging in plugin settings to see detailed logs
- Run the plugin health check from Settings → Plugins → Execute
- Ensure Retain and Recall are both enabled
- Check that Auto-Cognify is enabled (data must be cognified before it's searchable)
- Verify the dataset has data: check Cognee's
/api/v1/datasetsendpoint - Try a different Search Type (e.g.,
RAG_COMPLETIONfor simpler retrieval)
- Reduce Cache TTL to serve more from cache
- Switch to a lighter search type (
CHUNKSorSUMMARIES) - Reduce max token limits for recall and context
- Disable Auto-Cognify and run cognification manually during quiet periods
MIT
- Cognee by Topoteretes — the underlying AI memory platform
- Agent Zero by Jan Tomášek — the agentic framework
- Plugin architecture inspired by a0-hindsight and a0-plugin-honcho
- This plugin is part of the neurocis method for personal assistant memory, powering knowledge retention and semantic search for the Bibiotek agent (librarian)