Try it (3 commands)
·
Proof
·
vs Mem0 / Zep / Letta
·
Cloud
Weak model. Strong agent loop.
A model only writes the next tokens. An agent is the loop around it: tools, memory, repair, evidence, finish.
ContextMemory is that loop on the server — so a weaker model can still complete agent work on the same prompts.
Point any OpenAI-compatible client here (official OpenAI SDKs, LangChain, curl, Cursor). You keep your app. No LangGraph/CrewAI/Letta rewrite.
One /v1/chat/completions URL — markdown memory you can open, plus a harness that recovers tool calls, refuses fake “done”, and terminates.
Optional npm/PyPI packages only build the gateway headers (Authorization, X-App-Id, …) — header helpers. The product contract is /v1.
Proof (same model, harness off → on)
Same model, same prompts, adversarial suite (wiki · MCP · finish · anti-stuck · distractor).
Off = wire without recovery. On = weak harness.
| Off | On | Δ |
|---|
| Mean score | 13.5 | 100 | +86.5 |
| falseDone | 5/5 | 0/5 | — |
| Tasks passed | 0/5 | 5/5 | — |
Model: qwen3.6-35b-iq3s-mtp · run qwen35b-suite-2026-11-15T20-47-56-653Z
| Task | Off | On | What On fixed |
|---|
| Wiki live-data | 10 | 100 | Called tools → real host |
| MCP tool args | 10 | 100 | Valid MCP call → live fact |
| Finish evidence | 25 | 100 | Evidence before Yes/No |
| Anti-stuck | 17.5 | 100 | Pivot after noisy wiki |
| Distractor | 5 | 100 | Authoritative answer, not bait |
Honesty rule: if Off already passes, the task is invalid — we do not publish vanity Δ.
Full lift list + how to reproduce: benchmarks/ · small-model guide: docs/small-model-guide.md.
What you actually get
| Outcome | Why it matters |
|---|
| Send only the new message | Gateway keeps session memory; client stays dumb and portable |
| Memory you can open | Markdown wiki — edit, diff, audit. No opaque vector blob |
| Weak models that finish | Family/prose recovery, arg repair, finish gate, anti-stuck budget |
| Tools on the same URL | Wiki, sandbox, MCP — no second orchestrator |
| Safer by default | Skills, guardrails, validators, optional HITL before destructive acts |
| Any engine | BYO OpenAI-compatible /v1 (local or cloud), swap per app |
Not classic RAG. Not an agent OS. You keep your OpenAI client; the loop runs here.
Compare: docs/compare.md.
Try it in three commands
git clone https://github.com/Kortexio/ContextMemory.git && cd ContextMemory
docker compose -f docker-compose.yml -f docker-compose.llamacpp.yml up --build -d
./scripts/aha-chat.sh
Turn 1: "Remember: staging DB is postgres-staging-01."
Turn 2: "What is our staging database host?" ← no history in the request
AHA OK — the gateway remembered it.
Same check runs in CI on every push. Admin UI: http://localhost:5200.
Engines / Compose: docs/self-host.md.
Cursor / Claude (30 seconds)
cd mcp-server && npm install && node print-mcp-config.mjs
Paste into Cursor MCP settings. Chat A: Remember: staging DB is postgres-staging-01 → Chat B (new): What is our staging DB?
Already have an LLM?
docker run --rm -p 5100:8080 \
-v contextmemory-data:/app/data \
-e ContextMemory__MasterKey=cm_master_dev_key_change_me \
-e ContextMemory__Apps__demo-dev__ApiKey=cm_live_dev_key_change_me \
-e ContextMemory__Apps__demo-dev__LlmBackend=openai-compatible \
-e ContextMemory__Apps__demo-dev__LlmModel=local-model \
-e ContextMemory__Apps__demo-dev__LlmEndpoint=http://host.docker.internal:8080 \
--add-host=host.docker.internal:host-gateway \
ghcr.io/kortexio/contextmemory:latest
Zero ops: Kortexio Cloud (cmk_live_…). Self-host keeps full control (cm_live_… + X-App-Id).
Optional header helpers (same idea in JS and Python): @kortexio/contextmemory · kortexio-contextmemory
What the harness fixes (in one glance)
| Pain without it | With ContextMemory |
|---|
| Model writes tools in prose / weird markup | Lifted into real tool_calls (many model families) |
Empty {} MCP args | Schema + arg repair before execute |
“Done” after only tool_describe | Evidence finish gate — refuse discovery-only |
| Same wiki/MCP call forever | Duplicate guard, Continue, force-answer breakers |
| Invented MCP tool names | Remap onto the live catalog |
| Need a frontier model “to agent” | Weak harness closes most of the gap — see proof above |
Deep dive: benchmarks/README.md.
Docs
Website: kortexio.io · hello@kortexio.io
License
AGPL-3.0 — self-host freely, including commercially. Embed in closed-source without AGPL obligations? Use Kortexio Cloud or a commercial license → docs/license-and-support.md.