Skip to main content
Add persistent, queryable knowledge-graph memory to Pi with the community pi-cognee extension. Your agent can remember facts, recall them in later sessions, forget what’s outdated, and manage datasets — all from inside Pi.
pi-cognee is a community extension built and maintained by Kerry Hatcher (MIT licensed). It is not maintained by the Cognee team — report issues on the pi-cognee repository.
The extension offers two backends behind one interface: All memory tools work identically in both modes, so you can start with SDK mode and switch to a shared MCP server later without changing how you use the agent.

Install

Quick Start (SDK mode)

SDK mode runs Cognee in-process — no server needed. Set your LLM API key inside Pi:
Then start using memory in conversation:
Later — even in a new session — ask for it back:
Recall isn’t automatic — Pi decides when to call cognee_recall, and for questions it can answer from project files, a coding agent will usually read the files instead. Test with facts that aren’t in your codebase, or nudge it with “check your cognee memory”. Memory is also stored per working directory in SDK mode, so recall it from the directory where you stored it.
In SDK mode, Cognee’s own LLM calls (entity extraction, embeddings, search-time completions) run against the provider you configure with llmApiKey / llmModel and are billed by that provider — they don’t go through Pi’s model.

MCP Mode

To share memory across agents or use a self-hosted Cognee deployment, point the extension at a running Cognee MCP server (HTTP transport):
In MCP mode, LLM and database configuration lives on the server — only mcpUrl is needed locally.

Commands

Tools

The extension registers these tools with Pi; they behave the same in both modes:

Configuration Reference

Set values with /cognee-config <key> <value>: The SDK-mode keys map to the @cognee/cognee-ts constructor options — see that page for supported providers and models.

GitHub Repository

View the pi-cognee source code

npm Package

@kerryhatcher/pi-cognee on npm

TypeScript SDK

The @cognee/cognee-ts SDK powering SDK mode