LlamaIndex Integration
Drop-in LlamaIndex components backed by Dakera — persistent agent memory and server-side vector indexing with no local embedding model.
llamaindex-dakera · GitHub →Quick Start
Run Dakera
docker run -d \
--name dakera \
-p 3000:3000 \
-e DAKERA_ROOT_API_KEY=dk-mykey \
ghcr.io/dakera-ai/dakera:latest
curl http://localhost:3000/health
Install
pip install llamaindex-dakera
Requirements: Python ≥ 3.10, a running Dakera server.
Use it
from llama_index_dakera import DakeraMemoryStore, DakeraIndexStore
# Agent memory
memory = DakeraMemoryStore(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="my-agent",
)
# RAG index — server handles embedding
vector_store = DakeraIndexStore(
api_url="http://localhost:3000",
api_key="dk-mykey",
namespace="my-docs",
)
DakeraMemoryStore
Persistent conversation memory for LlamaIndex agents. Drop-in replacement for the default in-memory chat store.
ReAct agent with persistent memory
from llama_index.core.agent import ReActAgent
from llama_index.core.memory import ChatMemoryBuffer
from llama_index.llms.openai import OpenAI
from llama_index_dakera import DakeraMemoryStore
store = DakeraMemoryStore(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="react-agent",
)
memory = ChatMemoryBuffer.from_defaults(
token_limit=3000,
chat_store=store,
chat_store_key="user-1",
)
agent = ReActAgent.from_tools(
tools=[...],
llm=OpenAI(model="gpt-4o"),
memory=memory,
verbose=True,
)
# First session
response = agent.chat("My project is called NeuralBridge.")
# Later session — memory persists
response = agent.chat("What's the name of my project?")
print(response) # "Your project is called NeuralBridge."
DakeraMemoryStore options
| Parameter | Type | Default | Description |
|---|---|---|---|
api_url | str | — | Dakera server URL |
api_key | str | "" | Dakera API key |
agent_id | str | — | Namespace for this agent's memories |
top_k | int | 5 | Memories to retrieve per query |
min_importance | float | 0.0 | Minimum importance for recall |
DakeraIndexStore
Server-side embedded vector store for RAG. Dakera embeds documents on the server — no local model, no OpenAI embeddings API needed.
Indexing documents
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, StorageContext
from llama_index_dakera import DakeraIndexStore
documents = SimpleDirectoryReader("./docs").load_data()
vector_store = DakeraIndexStore(
api_url="http://localhost:3000",
api_key="dk-mykey",
namespace="product-docs",
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(
documents,
storage_context=storage_context,
)
query_engine = index.as_query_engine(similarity_top_k=4)
response = query_engine.query("How does the billing work?")
print(response)
Chat over your documents
from llama_index.core.chat_engine import CondensePlusContextChatEngine
from llama_index.core.memory import ChatMemoryBuffer
from llama_index_dakera import DakeraIndexStore, DakeraMemoryStore
vector_store = DakeraIndexStore(
api_url="http://localhost:3000",
api_key="dk-mykey",
namespace="product-docs",
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_defaults(storage_context=storage_context)
memory_store = DakeraMemoryStore(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="doc-chat",
)
chat_engine = CondensePlusContextChatEngine.from_defaults(
retriever=index.as_retriever(similarity_top_k=4),
memory=ChatMemoryBuffer.from_defaults(chat_store=memory_store),
)
response = chat_engine.chat("What are the pricing tiers?")
print(response)
DakeraIndexStore options
| Parameter | Type | Default | Description |
|---|---|---|---|
api_url | str | — | Dakera server URL |
api_key | str | "" | Dakera API key |
namespace | str | — | Vector namespace to read/write |
embedding_model | str | namespace default | Server-side embedding model override |
v0.2.0 — Sessions, Knowledge Graph, Entities & Namespaces
Version 0.2.0 adds four new classes for advanced memory management. All are importable from llama_index_dakera.
Session management
Group related memories into sessions. Track which memories were created during a specific agent run.
from llama_index_dakera import DakeraSessionManager
sessions = DakeraSessionManager(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="my-agent",
)
# Use as a context manager
with sessions.start(metadata={"task": "research"}) as session:
# Run your agent — all memories are grouped under this session
response = agent.chat("Research AI memory architectures")
# List active sessions
active = sessions.list(active_only=True)
# Get memories from a specific session
memories = sessions.memories(session_id=session.id)
Knowledge graph
Build and query a knowledge graph from your agent's stored memories.
from llama_index_dakera import DakeraKnowledgeGraph
kg = DakeraKnowledgeGraph(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="my-agent",
)
# Build the graph from stored memories
kg.build()
# Query the knowledge graph
results = kg.query(query="What has the agent learned?")
# Find paths between entities
path = kg.find_path(from_id="entity-1", to_id="entity-2")
# Export the full graph
graph = kg.export(format="json")
Entity extraction
Extract named entities from text and link them to memories.
from llama_index_dakera import DakeraEntityExtractor
extractor = DakeraEntityExtractor(
api_url="http://localhost:3000",
api_key="dk-mykey",
agent_id="my-agent",
)
# Extract entities from text
found = extractor.extract(
text="Alice from Acme Corp discussed the Q4 roadmap.",
entity_types=["person", "organization"],
)
# Get entities linked to a memory
linked = extractor.memory_entities(memory_id="mem_abc123")
Namespace management
Create and manage vector namespaces for organizing document collections.
from llama_index_dakera import DakeraNamespaceManager
ns = DakeraNamespaceManager(
api_url="http://localhost:3000",
api_key="dk-mykey",
)
# Create a namespace
ns.create(name="agent-docs", dimension=1024)
# List all namespaces
all_ns = ns.list_namespaces()
# Get namespace details and stats
info = ns.get(name="agent-docs")
stats = ns.stats(name="agent-docs")
Enhanced DakeraMemoryStore (v0.2.0)
The existing DakeraMemoryStore class gained new parameters in v0.2.0:
| Parameter | Type | Default | Description |
|---|---|---|---|
memory_type | str | "episodic" | Memory type: episodic, semantic, procedural, working |
tags | list | [] | Tags applied to stored memories |
session_id | str | None | Link memories to a session |
ttl_seconds | int | None | Auto-expire memories after N seconds |
New methods: hybrid_search(query, top_k) for combined BM25 + vector search, batch_get(queries) for parallel queries, and batch_delete(memory_ids) for bulk removal.
Related integrations
Links
- GitHub — dakera-llamaindex
- Dakera deploy — Docker Compose setup
- Dakera full documentation
- All integrations
Frequently Asked Questions
How do I add persistent memory to LlamaIndex?
Install the llamaindex-dakera package, initialize DakeraMemoryStore with your Dakera server URL and API key, then pass it as the chat_store to a ChatMemoryBuffer for your agent. Dakera handles embedding and retrieval server-side.
Does Dakera work with LlamaIndex?
Yes, via the official llamaindex-dakera integration package. It provides DakeraMemoryStore for agent memory and DakeraIndexStore as a vector store for RAG pipelines.
What does Dakera add to LlamaIndex?
Dakera provides persistent cross-session memory, hybrid BM25 + vector semantic search over past interactions, server-side document indexing with no local embedding model, knowledge graph construction, session management, and memory decay. Agents retain context across restarts.
Further reading: Vector Database vs Agent Memory · Knowledge Graphs for AI Agents · RAG-Augmented Memory pattern
Add persistent memory to your framework.
One Docker command starts the server. One pip or npm install gives your agents memory that survives the session.
Prefer managed hosting? Join the Dakera Cloud waitlist →