AutoGen integration
autogen-dakera (0.3.0) gives AutoGen agents persistent semantic memory on a Dakera server. DakeraMemory adds and queries one agent's memories, which survive restarts, so agents keep long-term context across conversations. This page is for Python developers building AutoGen agents.
Quick start
pip install autogen-dakera
Requires Python ≥ 3.10, dakera>=0.13.1 (installed automatically) and a running Dakera server. Works with Dakera server v0.12.0 and v0.11.108.
from autogen_dakera import DakeraMemory
memory = DakeraMemory(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="autogen-assistant",
)
memory.add("User is building a chatbot for customer support.")
results = memory.query("what is the user building?")
Features
- DakeraMemory — persistent semantic memory with importance scoring
- DakeraSessionManager — session lifecycle for conversation tracking
- DakeraKnowledgeGraph — entity-relationship graph operations
- DakeraEntityExtractor — automatic entity extraction
- DakeraNamespaceManager — multi-tenant namespace isolation
Examples
Basic agent memory
import os
from autogen_dakera import DakeraMemory
memory = DakeraMemory(
api_url=os.environ.get("DAKERA_API_URL", "http://localhost:3000"),
api_key=os.environ.get("DAKERA_API_KEY", ""),
agent_id="autogen-assistant",
recall_k=3,
importance=0.8,
)
memory.add("User is building a chatbot for customer support.")
memory.add("The chatbot should handle returns, refunds, and order tracking.")
memory.add("Preferred tech stack: Python backend, React frontend.")
results = memory.query("what is the user building?")
for r in results:
print(f" [{r['score']:.3f}] {r['content']}")
Conversation history across sessions
from autogen_dakera import DakeraMemory
memory = DakeraMemory(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="autogen-chat",
recall_k=5,
importance=0.7,
)
# Store conversation turns
memory.add("Human: What's the capital of France?\nAI: Paris.")
memory.add("Human: I'm planning to visit.\nAI: Great! Paris has amazing museums.")
# Later session — recall relevant context
results = memory.query("travel plans")
for r in results:
print(f" [{r['score']:.3f}] {r['content']}")
API reference
DakeraMemory options
| Parameter | Type | Default | Description |
|---|---|---|---|
api_url | str | — | Dakera server URL |
api_key | str | "" | API key |
agent_id | str | — | Agent identifier |
recall_k | int | 5 | Results per query |
min_importance | float | 0.0 | Minimum importance of returned memories |
importance | float | 0.7 | Default importance for stored memories |
Configuration
The package does not read environment variables. To keep the URL and key out of source code, read them yourself:
import os
from autogen_dakera import DakeraMemory
memory = DakeraMemory(
api_url=os.environ["DAKERA_API_URL"],
api_key=os.environ.get("DAKERA_API_KEY", ""),
agent_id="autogen-assistant",
)
Links
AutoGen + Dakera in production
Persistent memory for AutoGen agents: context recalled across sessions, with importance-weighted decay, on your own Dakera server.
Other Python integrations: LangChain · CrewAI · LlamaIndex