Feature: DakeraMemoryStore — decay-weighted persistent memory backend for SK Memory

Open
#14,130 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, python
Domain
ai, backend

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.

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 interface
  • python/semantic_kernel/memory/volatile_memory_store.py — reference implementation
  • python/semantic_kernel/connectors/memory/ — existing third-party connectors

Happy to open a PR with the full implementation across Python and optionally C# (.NET) variants.

Dominant language
C#
Stars
28.8k
Forks
4.9k
Avg merge
2d 17h
Merged PRs (30d)
48

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/semantic-kernel

All issues in microsoft/semantic-kernel

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.