Who it is forA Python developer building a custom agent who needs it to keep context from earlier turns and sessions.
The problemThe agent loses earlier conversation context and has no shared memory layer to query.
The outcomeEach turn is captured and relevant memory is returned as prompt-ready text before the next model call.
What you need first
- Python 3.12 or newer
- pip to install the octop-memory package
- A database path for local SQLite storage, or a PostgreSQL DSN for server deployments
- An injected LLMClient only if you want automated extraction, promotion, or page regeneration; manual storage and lexical recall work without a model
Steps
- Run
pip install octop-memory - Create a Memory object with namespace="<namespace>" and backend_config={"db_path": "<db path>"}
- Wrap it with MemoryService(memory) in your agent code
- Call capture_turn() after each exchange, and recall("<query>") before each model call
- Inject result.rendered into the model prompt and print it during testing
Prompt for your agent
Use the octop-memory repo to wire MemoryService into the agent in <project path> with the SQLite database at <db path>. Run one captured turn and one recall with the query <query>, then return result.rendered. Verify that the recall output includes the text from the captured turn.
Caveat. Automated capture and extraction depend on the LLMClient you inject, because the package does not configure a model on install.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for TencentCloud/octop-memory and "Add capture and recall to a custom Python agent"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer