Integration

Long-term memory for Microsoft Semantic Kernel

Microsoft Semantic Kernel ships with in-process memory connectors (volatile, Azure Cognitive Search, Postgres) but no opinionated hybrid-retrieval layer, and no graph. `EngramPlugin` is a first-party SK plugin: `kernel.add_plugin(EngramPlugin(bucket='...'), plugin_name='engram')` surfaces three `@kernel_function`-decorated tools (`store_memory`, `query_memory`, `list_memories`) to whichever chat-completion service the kernel is driving — Azure OpenAI, OpenAI, Anthropic, or any other SK connector.

Install

Three steps: sign up for an Engram API key, paste a BYOK LLM-provider key on /models, then drop the snippet below into Semantic Kernel.

Three steps to memory in your agent

  1. Sign up. Free, no card. You'll land on a Getting Started page that walks the next two steps.
  2. Add your LLM key. Engram is BYOK. Paste an OpenAI / Anthropic / Groq / Together / Fireworks key and we'll route every extraction and query call through your provider. You pay your provider directly. We never see your inference.
  3. Paste the snippet below into your agent and restart it. Use Authorization: Bearer <api-key>with the API key from your portal.

EngramPlugin: first-party SK plugin

Exposes three @kernel_function-decorated tools (store_memory, query_memory, list_memories) — destructive ops are deliberately not surfaced to the model. Source: github.com/lumetra-io/engram-semantic-kernel.

  1. Clone and install (not yet on PyPI):
  2. Terminal
    git clone https://github.com/lumetra-io/engram-semantic-kernel
    cd engram-semantic-kernel && pip install -e .
    export ENGRAM_API_KEY="<api-key>"
  3. Add the plugin to your kernel:
  4. Python
    from semantic_kernel import Kernel
    from engram_semantic_kernel import EngramPlugin
    
    kernel = Kernel()
    kernel.add_plugin(EngramPlugin(bucket="my-app"), plugin_name="engram")
  5. Any SK chat-completion service (Azure OpenAI / OpenAI / Anthropic / etc.) sees the three tools via SK's function-calling loop. For per-tenant scoping, construct EngramPlugin(bucket=f"tenant-{tenant_id}") per request.

What you can do once memory's wired in

  • Add durable memory to an Azure OpenAI-backed SK agent with one `kernel.add_plugin(EngramPlugin(...))` call
  • Use SK's function-calling loop to let the model decide when to `store_memory` vs `query_memory` mid-conversation
  • Per-tenant buckets via `EngramPlugin(bucket=f'tenant-{tenant_id}')` constructed per request
  • Inject a pre-built `EngramClient` so a single client is shared across SK plugins, BYOK fetch, and your own code paths

FAQ

Why are `delete_memory` and `clear_memories` not exposed to the model?

Destructive tools handed to an LLM are a footgun — one bad call wipes a bucket. The plugin intentionally surfaces only the three non-destructive tools as `@kernel_function`s. If you need destructive operations, call them on `EngramPlugin(...).client` directly from your own Python.

Is this on PyPI?

Not yet. This is a recipe-style install: `git clone https://github.com/lumetra-io/engram-semantic-kernel && pip install -e .`. The `Annotated[type, 'description']` parameter annotations follow the canonical SK pattern so the model sees them in the tool schema.

Does this replace Microsoft Agent Framework?

No — they're complementary. Semantic Kernel is the kernel/plugin orchestration layer; Microsoft Agent Framework (`agent-framework>=1.5`) is the newer agent runtime. We ship a separate `EngramTools` integration for Agent Framework. Pick whichever matches your existing stack.

Ship durable memory in Semantic Kernel today

Free tier: 10K memories and 50K retrievals per month. No credit card. Same Engram backend powers all 41 integrations, so memories you write from one client are immediately queryable from the rest.