AutoGen Integration
The autogen-dakera package provides persistent semantic memory for AutoGen agents. Memories survive across sessions, enabling long-term context in multi-agent conversations.
Quick Start
pip install autogen-dakera
Requires Python ≥ 3.10 and a running Dakera server.
from autogen_dakera import DakeraMemory
memory = DakeraMemory(
api_url="http://localhost:3300",
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:3300"),
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:3300",
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?
AI: Paris.")
memory.add("Human: I'm planning to visit.
AI: 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 |
importance | float | 0.7 | Default importance for stored memories |
Configuration
export DAKERA_API_URL=http://localhost:3300
export DAKERA_API_KEY=dk-your-key