[Feature] Dakera integration — persistent decay-weighted user memory across RAG chat sessions
Problem
Kotaemon does excellent RAG — users upload documents, ask questions, get grounded answers. But the user's own context (preferences, past questions, learned facts) isn't remembered across chat sessions.
If I tell kotaemon in session 1 that I'm a cardiologist reviewing drug trial data, session 2 starts with no context. The document knowledge is persistent; the user knowledge is not.
Proposed: Dakera as a user memory layer
Dakera is a self-hosted vector memory server with decay weighting. It complements kotaemon's document RAG with user memory — what the user has told the system.
Integration point in libs/ktem/ktem/reasoning/ or the pipeline construction:
from dakera import DakeraClient
_memory = DakeraClient(base_url="http://localhost:3300", api_key="demo")
def augment_with_user_memory(user_id: str, query: str, doc_context: str) -> str:
"""Add user memory context to the retrieved document chunks."""
resp = _memory.recall(agent_id=user_id, query=query, top_k=3)
user_ctx = "\n".join(f"- {m.content}" for m in (resp.memories or []))
if not user_ctx:
return doc_context
return f"User context (prior sessions):\n{user_ctx}\n\nDocument context:\n{doc_context}"
def store_exchange(user_id: str, question: str, answer: str) -> None:
_memory.store_memory(
agent_id=user_id,
content=f"Q: {question}\nA: {answer}",
)Why this matters
Kotaemon users often build document-centric knowledge bases for specific domains. Domain experts who use kotaemon repeatedly would benefit from the assistant remembering their expertise level, vocabulary, and prior queries — so follow-up questions can skip re-establishing context.
Decay weighting means old preferences naturally fade, keeping the recalled context fresh and relevant.
Setup
docker run -d -p 3300:3300 -e DAKERA_API_KEY=demo ghcr.io/dakera-ai/dakera:latest
pip install dakeraSelf-hosted — fits kotaemon's privacy-first model. Happy to prototype as a PR.
Source: Cinnamon/kotaemon