AegisDB – self-hosted memory for AI agents, in one C binary AegisDB, a self-hosted memory database for AI agents, has been released as a single C binary with multi-tenant support, encryption, backups, and observability. The tool provides durable long-term memory for AI agents, including episodic history, semantic facts with vector search, and working memory, while keeping data on the user's infrastructure. It includes a native integration with Claude Code and is designed for production use with crash recovery and security features. Self-hosted memory for your AI agents.One small C binary — multi-tenant, encrypted, with backups, read replicas, and a one-command Prometheus + Grafana stack. Your agents' memory stays on your box; nothing ships to a SaaS. AI agents forget everything between sessions. AegisDB gives them durable, searchable long-term memory — episodic history, semantic facts with vector search, and volatile working memory — behind a dead-simple JSON-over-TCP protocol, with a first-class Claude Code use-as-claude-code-memory integration. It's a single dependency-free binary you run yourself: your data, your box, no third party in the loop. Run the server — no clone, no toolchain prebuilt multi-arch image on GHCR : docker run -d --name aegisdb -p 9470:9470 -v aegis-data:/data \ ghcr.io/d4n-larsson/aegisdb:latest Talk to it — the same binary is also the client: docker exec aegisdb aegisdb client ping docker exec aegisdb aegisdb client put --type semantic --tags user "prefers dark mode" docker exec aegisdb aegisdb client search --tags user --top-k 5 Want the whole observability stack server + Prometheus + a pre-built Grafana dashboard in one command? Clone this repo and: docker compose --profile monitoring up dashboard on http://127.0.0.1:3000 Giving Claude Code a persistent memory is a one-liner with a server running : uvx --from aegisdb-mcp aegisdb-init — see Use as Claude Code memory use-as-claude-code-memory . Self-hosted & private. Your agents' memory never leaves your infrastructure — no SaaS, no per-token billing, no data-sharing. Encrypt it at rest with one flag. One binary, no dependencies. Written in C; the only vendored code is cJSON and the crypto. No JVM, no Python runtime, no external database to babysit. Built for teams. Multi-tenant auth per-namespace, scoped tokens , per-tenant quotas + rate limits, online backups, read replicas, and turnkey Prometheus/Grafana observability. Claude Code native. Ships an MCP server + hooks so Claude remembers across sessions — installable with a single command. Production-minded. Corruption-resilient append-only log, crash recovery, a documented security review, and CI that runs ASan/UBSan/TSan plus continuous fuzzing. Durable episodic memory — append-only log with magic + CRC32 framing, corruption-resilient recovery, and legacy-log migration Semantic facts — updateable records latest version wins Working memory — volatile per-session ring buffer with TTL and promotion Retrieval — lookup by ID, time-range search, tag search all / any , semantic embedding search ranked by cosine similarity weighted by importance × confidence; count and consolidate dedup over the same filters Semantic scale — exact cosine while small; past --ann-threshold an HNSW graph for sublinear approximate top-K, built off the write path and sharded so the build parallelizes --ann-shard-target , optionally int8-quantized Relationships — directed edges between records, graph traversal, and agent-namespace isolation Multi-tenant auth — optional bearer tokens constant-time check; ping exempt , each bound to a namespace + scope ro / rw /admin so one server safely isolates many tenants Per-tenant limits — optional storage quotas records/bytes and a request rate limit per namespace, so one team member's runaway agent can't fill the disk or monopolize the shared server Encryption at rest — optional XChaCha20-Poly1305 vendored, no crypto dependency over the log + checkpoints; opt-in via --encryption-key-file , with an offline migrator and encrypted backups/replicas Observability — stats op plus a drop-in Prometheus exporter + Grafana dashboard /d4n-larsson/aegisdb/blob/main/integrations/prometheus-exporter docker compose --profile monitoring up Operations — online snapshot /restore backups and read replicas Concurrency — sharded poll event-loop threads --io-threads ; selectable fsync durability sync / batch / interval - Linux primary target with GCC 11+ or Clang 14+ - One of: CMake 3.20+ or GNU Make - Python 3.8+ optional, for the example client below cmake -B build -DCMAKE BUILD TYPE=Release cmake --build build ctest --test-dir build --output-on-failure runs the unit test suite make builds build/aegisdb make test builds and runs the C unit tests make integration wire-protocol contract tests launches the server make check unit + integration make clean The server binary is produced at build/aegisdb . Prebuilt multi-arch images linux/amd64 , linux/arm64 are published to GitHub Container Registry on every push to main and every release tag — no clone or toolchain needed: docker run -p 9470:9470 -v aegis-data:/data ghcr.io/d4n-larsson/aegisdb:latest or pin a release: ghcr.io/d4n-larsson/aegisdb:0.1.0 To build it yourself instead, a multi-stage Dockerfile Debian-slim compiles the server and ships a minimal runtime image. Data persists in a named volume at /data . Build and run with Docker Compose docker compose up --build serves on localhost:9470 Or build and run the image directly docker build -t aegisdb . docker run -p 127.0.0.1:9470:9470 -v aegis-data:/data aegisdb Compose is configured by an optional .env file — copy the template and edit: cp .env.example .env then tweak port, durability, tenant limits, … docker compose up --build Every setting has a default, so .env is optional. It exposes the common flags as named vars AEGIS PORT , AEGIS EMBEDDING DIM , AEGIS DURABILITY , AEGIS TENANT MAX RECORDS , … plus AEGIS EXTRA ARGS for anything else --auth-token-file , --io-threads , ANN tuning, … . See .env.example /d4n-larsson/aegisdb/blob/main/.env.example for the full list. To skip building, point docker-compose.yml at the published image: replace build: . with image: ghcr.io/d4n-larsson/aegisdb:latest . The image ships a HEALTHCHECK that uses the binary's built-in --health-check probe no extra tooling in the image , so docker ps and Compose depends on: condition: service healthy reflect real server liveness. The container runs as an unprivileged user. The server listens on 0.0.0.0:9470 inside the container, but Compose publishes that port on the host's loopback 127.0.0.1 only by default — because the wire protocol is unauthenticated and plaintext out of the box, it must not be reachable off-box until you secure it. To expose it deliberately, set AEGIS BIND=0.0.0.0 or a specific host IP in .env , and first enable authentication: mount a token file into /data and add --auth-token-file /data/tokens.txt to AEGIS EXTRA ARGS under Compose; see Authentication authentication . Even with auth, tokens travel in plaintext, so terminate TLS at a trusted proxy for any non-loopback exposure. Override other flags by appending them to the run command, e.g. docker run aegisdb --embedding-dim 1024 , or with Compose via .env . ./build/aegisdb --data-dir ./data --port 9470 Expected startup output: 2026-06-28 12:00:00.000 INFO aegisdb AegisDB 0.1.0 starting log level: info 2026-06-28 12:00:00.000 WARN aegisdb no auth tokens configured; ... 2026-06-28 12:00:00.000 INFO aegisdb recovery complete: N records loaded 2026-06-28 12:00:00.000 INFO aegisdb listening on 0.0.0.0:9470 2026-06-28 12:00:00.000 INFO aegisdb data directory: ./data Logs go to stderr as