Active

Context

Personal memory for AI agents

A self-hosted memory service for AI agents, reached over MCP.

I run the service myself. Agents call it over MCP with search, remember, read and timeline. On 60 synthetic notes, 10 of 12 questions got complete answers.

Problem

I work with several AI agents: ChatGPT, Codex and my own bots. Each keeps its own memory, and that memory is lost when I switch client or provider. I kept re-explaining project decisions. I needed one memory that belongs to me, runs on my server and is open to any agent.

What was built

Context is an MIT-licensed service for a single owner. One container, one SQLite database, standard MCP. Agents see four tools: search, remember, read and timeline. A note saved by one agent can be found by another. Archives can be imported from GitHub and Codex sessions. Every night the service verifies a database snapshot, collapses near-identical records and sorts the inbox with Codex.

Key decisions

  • Keep originals and build understanding separately

    Each source is stored unchanged, with date and checksum, after secrets are redacted. In a synthetic experiment on 60 notes, 10 of 12 questions got complete answers, and background knowledge extraction did not improve them. There was no semantic search yet. So agents answer from originals, and summaries stay secondary.

  • Replace facts only explicitly

    At first the nightly tidy decided by itself which note was outdated. I removed automatic replacement. Now an agent passes supersedes itself when it knows a fact has changed.

  • Search without paid services

    SQLite full-text search with Russian and English stemming, plus a small embedding model on the same server. If the model is unavailable, plain search still works.

  • Built-in sign-in instead of a separate service

    Keycloak with its own database handled auth at first. I replaced it with built-in OAuth 2.1, password and passkey. Headless agents get tokens limited to specific areas.

Stack

  • TypeScript
  • Node.js
  • SQLite
  • MCP SDK
  • OAuth 2.1 and WebAuthn
  • Transformers.js with multilingual-e5-small
  • Docker
  • Model steps run through an OpenAI-compatible API or Codex.

Status and next

Runs on my server as shared memory for my agents. Next: an owner web UI for search, inbox and deletion, ChatGPT and Telegram imports, hard delete.