microsoft / microsoft/semantic-kernel
Feature: DakeraMemoryStore — decay-weighted persistent memory backend for SK Memory
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 28.6k
- Forks
- 4.8k
- Avg merge
- 14h 13m
- Merged PRs (30d)
- 18
Description
Summary
Semantic Kernel's memory system accepts pluggable IMemoryStore implementations (Python: MemoryStoreBase). This issue proposes a DakeraMemoryStore that brings decay-weighted, cross-session persistence to SK agents without requiring Weaviate, Azure AI Search, or other heavy vector database deployments.
Problem
SK's built-in memory stores (volatile in-process, SQLite) lose all data on restart. Connecting to Azure AI Search or Weaviate adds cost and infrastructure complexity for teams that want persistent agent memory. None of the existing backends implement relevance decay — a stale memory from 3 months ago ranks as high as one from yesterday.
Proposed Solution
A DakeraMemoryStore implementing SK's memory interface:
from semantic_kernel.memory.memory_store_base import MemoryStoreBase
from semantic_kernel.memory.memory_record import MemoryRecord
from dakera import DakeraClient
class DakeraMemoryStore(MemoryStoreBase):
"""Dakera-backed SK memory store with decay-weighted recall.
Setup: docker run -d -p 3300:3300 -e DAKERA_API_KEY=demo ghcr.io/dakera-ai/dakera:latest
"""
def __init__(self, base_url: str = "http://localhost:3300", api_key: str = ""):
self._client = DakeraClient(base_url=base_url, api_key=api_key)
async def get_nearest_matches_async(
self,
collection_name: str,
embedding: ndarray,
limit: int,
min_relevance_score: float = 0.0,
with_embeddings: bool = False,
) -> List[Tuple[MemoryRecord, float]]:
response = await self._client.recall_async(
agent_id=collection_name,
query=embedding.tolist(),
top_k=limit,
)
return [
(self._to_memory_record(m), m.score)
for m in (response.memories if response else [])
if m.score >= min_relevance_score
]
async def upsert_async(self, collection_name: str, record: MemoryRecord) -> str:
return await self._client.store_memory_async(
agent_id=collection_name,
content=record.text,
metadata={"id": record.id, **record.additional_metadata},
)
# ... get_async, remove_async, get_collections_async
Usage with the SK kernel:
import semantic_kernel as sk
kernel = sk.Kernel()
kernel.add_memory_store(DakeraMemoryStore(
base_url="http://localhost:3300",
api_key="demo",
))
# Store and recall work as normal
await kernel.memory.save_information_async("user-profile", id="pref1", text="prefers concise answers")
results = await kernel.memory.search_async("user-profile", "response style", limit=3)
Why Dakera vs Azure AI Search / Weaviate
| Azure AI Search | Weaviate | Dakera | |
|---|---|---|---|
| Decay weighting | ❌ | ❌ | ✅ |
| Self-hosted | ❌ (cloud) | ✅ (complex) | ✅ (1 container) |
| Cost | Per-query billing | Infrastructure | Free self-hosted |
| Session isolation | Manual | Manual | Built-in |
| Setup complexity | High (portal + keys) | Medium | Low (single Docker cmd) |
Key Differentiator: Decay Weighting
Dakera assigns time-based and access-frequency decay weights to each memory. When SK agents search memory, results ranked by recency and access patterns — not just semantic similarity. Stale context from months ago won't pollute current task context.
Setup
docker run -d -p 3300:3300 -e DAKERA_API_KEY=demo ghcr.io/dakera-ai/dakera:latest
pip install dakera
Relevant Files
python/semantic_kernel/memory/memory_store_base.py— abstract interfacepython/semantic_kernel/memory/volatile_memory_store.py— reference implementationpython/semantic_kernel/connectors/memory/— existing third-party connectors
Happy to open a PR with the full implementation across Python and optionally C# (.NET) variants.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with python/semantic_kernel/memory/memory_store_base.py and compare python/semantic_kernel/memory/volatile_memory_store.py with connectors under python/semantic_kernel/connectors/memory/. Determine the complete MemoryStoreBase contract and how the Dakera client is expected to behave. Done means a complete DakeraMemoryStore covering the proposed memory operations, with its integration and compatibility verified against the existing interface.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- ai, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100