# Aletheia

> Aletheia (npm package aletheia-mem) is a free, local memory and rules hub for AI coding tools such as Claude Code, Codex CLI, Cursor, Gemini CLI, Windsurf and OpenCode. One SQLite store is read over MCP, REST or CLI. Apache-2.0, no account, no telemetry. Alpha status.

Aletheia is a small server, a command line tool and an MCP server over one local SQLite file. Hooks in each AI coding tool capture sessions, secrets are redacted before storing, and the next session gets the relevant context back. Rules are written once and synced into each tool's own instruction file. Every page below is plain Markdown. Real-tool verification is stated per tool; answer accuracy is not measured.

## Get started

- [Introduction to Aletheia, a local memory hub for AI coding tools](https://aletheia.mohamedashrafelsaed.com/docs/start/introduction.md): Aletheia (aletheia-mem) is a free, local memory and rules hub that gives AI coding tools persistent memory over MCP, REST and a CLI.
- [Install Aletheia with npm, git or Docker](https://aletheia.mohamedashrafelsaed.com/docs/start/installation.md): Install Aletheia (aletheia-mem) with npm, git or Docker, start the server on port 37790, set up auto-start, update it and remove it. Needs Bun 1.1+.
- [Quickstart: save, search and recall a memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/start/quickstart.md): A ten-minute path through Aletheia (aletheia-mem): start the server, save and search memories, print session context, add a rule, preview the installer.
- [How Aletheia works: capture, redact, store, compress, recall](https://aletheia.mohamedashrafelsaed.com/docs/start/how-it-works.md): How Aletheia (aletheia-mem) turns hook events into memory: capture, redaction, SQLite storage, queued fact extraction and session-start context.
- [The Aletheia dashboard: five tabs for memory, rules and tools](https://aletheia.mohamedashrafelsaed.com/docs/start/dashboard.md): A tour of the Aletheia (aletheia-mem) dashboard: what Home, Activity, Knowledge, Rules and Connections show, and what you can change in each.
- [Aletheia FAQ: memory, privacy, tools and limits](https://aletheia.mohamedashrafelsaed.com/docs/start/faq.md): Short answers about Aletheia (aletheia-mem): cost, data location, privacy, which tools it connects to, deleting memory, offline use and its alpha status.

## Concepts

- [Aletheia memory model: memories, facts, episodes and rules](https://aletheia.mohamedashrafelsaed.com/docs/concepts/memory-model.md): What Aletheia stores in hub.db: memory kinds and types, facts, episodes, entities, rules, project and global scope, pin, dismiss and importance.
- [Rules: write standing instructions once and sync them to every tool](https://aletheia.mohamedashrafelsaed.com/docs/concepts/rules.md): How Aletheia rules work: scopes, enabled, stale, confirm and retire, the managed block in each tool file, preview, diff, lint, sync and import.
- [Search: keyword, project scope and optional semantic search](https://aletheia.mohamedashrafelsaed.com/docs/concepts/search.md): How Aletheia search works: FTS5 keyword search, project scope and --scope all, --explain, optional semantic search, ranking and the agent search pattern.
- [Session-start context: what a new AI session receives](https://aletheia.mohamedashrafelsaed.com/docs/concepts/session-context.md): What the Aletheia session-start block holds: the day-grouped index, legend, fetch hint, token estimate, the context.facts setting and how to shrink it.
- [Privacy and redaction in Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/concepts/privacy.md): What Aletheia stores and where, which secrets it redacts and which it misses, how private blocks work, what can leave your machine, and how to erase data.
- [33. Facts](https://aletheia.mohamedashrafelsaed.com/docs/33-facts.md): Facts are the atomic, declarative pieces of memory that sit under summaries, search and the session-start context. They are extracted from captured memory, never from a model's ...
- [Aletheia glossary: terms used in the documentation](https://aletheia.mohamedashrafelsaed.com/docs/concepts/glossary.md): Plain definitions of the terms used in the Aletheia docs: memory, observation, fact, episode, rule, hook, host, hub, spool, redaction, FTS5, MCP and more.

## Connect your tools

- [Connect AI coding tools to Aletheia: overview and verification status](https://aletheia.mohamedashrafelsaed.com/docs/tools/overview.md): Which AI coding tools Aletheia connects to, what full and mcp+rules mean, how the dry run works, and what was tested on a real install.
- [Claude Code memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/claude-code.md): Install Aletheia memory in Claude Code: the MCP entry, five hooks and CLAUDE.md rules block it writes, how to verify it, and what was tested.
- [Command Code memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/command-code.md): Install Aletheia memory in Command Code: the MCP entry, three hooks and AGENTS.md rules block it writes, what it cannot capture, and what was tested.
- [Codex CLI memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/codex.md): Install Aletheia memory in Codex CLI: the config.toml MCP entry, five hooks and AGENTS.md rules block it writes, the /hooks review, and what was tested.
- [Cursor memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/cursor.md): Install Aletheia memory in Cursor: the mcp.json entry, six hooks in hooks.json and the .mdc rules file, with the status that none of it ran in Cursor.
- [Gemini CLI memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/gemini-cli.md): Install Aletheia memory in Gemini CLI: the settings.json MCP entry and five hooks, the GEMINI.md rules block, and the status that no hook ran.
- [Windsurf memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/windsurf.md): Install Aletheia memory in Windsurf (now documented as Devin Desktop): the MCP entry, four Cascade hooks and rules files, with the status that no hook ran.
- [OpenCode memory with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/opencode.md): Connect OpenCode to Aletheia: the opencode.json MCP entry and AGENTS.md rules block it writes, why no hooks are installed, and what was tested.
- [Claude Desktop and the aletheia MCP server](https://aletheia.mohamedashrafelsaed.com/docs/claude-desktop.md): Claude Desktop speaks MCP over stdio. Aletheia's server is bin/mcp.mjs; one JSON entry under mcpServers is all it needs. No hook and no rules file exist for Claude Desktop, so t...
- [GitHub Copilot, Aider and any MCP client with Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/tools/other-tools.md): Use Aletheia with GitHub Copilot and Aider rules files, any MCP client over stdio, the REST API with curl, and the CLI in scripts and cron.
- [25. Installers and automatic capture](https://aletheia.mohamedashrafelsaed.com/docs/25-installers.md): Status: implemented and validated 2026-10-26. This page records what each installer writes, which hook fields it reads, and what is verified on this machine. Five more hosts and...

## Guides

- [Migrate from claude-mem to Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/guides/migrate-from-claude-mem.md): Import your claude-mem observations, summaries and prompts into Aletheia, run both side by side, switch the Claude Code hook and roll back.
- [Write your AI coding rules once and sync them to every tool](https://aletheia.mohamedashrafelsaed.com/docs/guides/write-rules-once.md): Add rules once in Aletheia, preview the change, lint them, and write them into CLAUDE.md, AGENTS.md and other tool files with a backup.
- [Back up, export and move Aletheia memory between machines](https://aletheia.mohamedashrafelsaed.com/docs/guides/backup-export-import.md): Export Aletheia memory and rules as JSONL or Markdown, copy hub.db safely with its WAL files, import on another machine, and erase with a receipt.
- [Run Aletheia as a background service (systemd, launchd, Docker)](https://aletheia.mohamedashrafelsaed.com/docs/guides/run-as-a-service.md): Generate a systemd user unit or a macOS launchd plist for the Aletheia server, set CPU and memory limits, read logs, upgrade, or run it in Docker.
- [Model providers: none, Claude CLI, OpenAI-compatible and Ollama](https://aletheia.mohamedashrafelsaed.com/docs/guides/model-providers.md): Choose how Aletheia extracts facts: rule-based with no model, the Claude CLI, an OpenAI-compatible API or Ollama, plus env vars and privacy notes.
- [Troubleshooting Aletheia: port in use, MCP closed, no memories and more](https://aletheia.mohamedashrafelsaed.com/docs/guides/troubleshooting.md): Fix common Aletheia problems: EADDRINUSE, MCP CONNECTION_CLOSED, an old dashboard, E404 on install, missing memories, locked or corrupt database.
- [29. Aletheia Sync](https://aletheia.mohamedashrafelsaed.com/docs/29-sync.md): Status: implemented, 2026-10-26. This page describes the code that exists.
- [30. The private remote MCP endpoint](https://aletheia.mohamedashrafelsaed.com/docs/30-remote-mcp.md): Status: implemented, 2026-10-26. This page describes the code that exists and is tested by test/remote-mcp.test.mjs.
- [31. Team mode](https://aletheia.mohamedashrafelsaed.com/docs/31-team.md): Status: implemented and tested, 2026-10-26. This page describes what the code does. It does not claim SSO, SCIM, compliance certificates or an SLA; none of those are built.
- [32. Requests, goals, story and economics](https://aletheia.mohamedashrafelsaed.com/docs/32-requests.md): Status: implemented, 2026-10-27. This page describes the code that exists: src/hub/requests.mjs, goals-rollup.mjs, artifacts.mjs, story.mjs, economics.mjs, rule-suggest.mjs, rul...

## Reference

- [Aletheia CLI reference: every aletheia command and flag](https://aletheia.mohamedashrafelsaed.com/docs/reference/cli.md): Every aletheia command and flag with a synopsis and a real example: capture, search, rules, install, sync, team, service, erase and alerts.
- [MCP tools reference: the 13 Aletheia MCP tools and their inputs](https://aletheia.mohamedashrafelsaed.com/docs/reference/mcp-tools.md): The 13 tools the Aletheia MCP server lists, with input schemas, read or write access, example calls and results, plus stdio and HTTP setup.
- [Aletheia configuration reference: environment variables, settings and data directory](https://aletheia.mohamedashrafelsaed.com/docs/reference/configuration.md): Every Aletheia environment variable with its default, the runtime settings and where they are stored, and the files in the data directory.
- [Aletheia hooks reference: events, payloads, redaction and fail-open behavior](https://aletheia.mohamedashrafelsaed.com/docs/reference/hooks.md): How Aletheia hooks work: events per host, payload fields read, redaction, fail-open exit 0, the spool, timeouts, and how to test or remove a hook.
- [3. HTTP API](https://aletheia.mohamedashrafelsaed.com/docs/03-http-api.md): Base: http://127.0.0.1:<port>. All JSON responses carry Cache-Control: no-store. Pages carry Content-Security-Policy: frame-ancestors 'none' and X-Frame-Options: DENY.

## Compare

- [claude-mem alternative: Aletheia compared with claude-mem](https://aletheia.mohamedashrafelsaed.com/docs/compare/aletheia-vs-claude-mem.md): A fair, sourced comparison of Aletheia and claude-mem: where claude-mem is ahead, where Aletheia differs, measured LoCoMo retrieval numbers.
- [Memory tools compared: Aletheia, Mem0, Zep and Graphiti, Supermemory, Basic Memory](https://aletheia.mohamedashrafelsaed.com/docs/compare/memory-tools.md): Aletheia compared with Mem0, Zep and Graphiti, Supermemory and Basic Memory on licence, local use, MCP and hosting, each fact sourced and dated.
- [Claude Code memory options: CLAUDE.md, auto memory, MCP servers and Aletheia](https://aletheia.mohamedashrafelsaed.com/docs/compare/claude-code-memory.md): How persistent memory works in Claude Code: CLAUDE.md files, auto memory, MCP servers, plugins and hooks, and where Aletheia fits beside them.

## Project

- [Aletheia benchmarks: how to reproduce every published number](https://aletheia.mohamedashrafelsaed.com/docs/project/benchmarks.md): The five benchmark commands behind every Aletheia number, what each one measures, the results with dates, what is not measured and the negative results.
- [Aletheia status and limits: alpha, what is verified and what is not](https://aletheia.mohamedashrafelsaed.com/docs/project/status-and-limits.md): Aletheia is alpha. This page lists what tests cover, what ran on real tools, what is unverified, platform status and how to report from a real install.
- [Dependencies](https://aletheia.mohamedashrafelsaed.com/docs/dependencies.md): Aletheia has no required runtime dependencies. It uses the Bun standard library and Bun's built-in SQLite binding only. The audit that enforces this is scripts/audit-deps.mjs:

## Internals

- [1. Architecture](https://aletheia.mohamedashrafelsaed.com/docs/01-architecture.md): claude-mem is a memory plugin for coding agents. Its worker (scripts/worker-service.cjs, a 4.2 MB Bun bundle) records every prompt, tool call, observation and session summary in...
- [2. Data model](https://aletheia.mohamedashrafelsaed.com/docs/02-data-model.md): Opened with readonly: true, PRAGMA queryonly = ON, busytimeout = 1500. Every SELECT goes through a helper that turns "no such table" and "no such column" into an empty result, s...
- [6. Frontend](https://aletheia.mohamedashrafelsaed.com/docs/06-frontend.md): Aletheia has one app page at /. It is plain HTML, CSS and JavaScript: no framework, no build step, no font file, no CDN and no dependency. It works offline. The older claude-mem...
- [7. Operations](https://aletheia.mohamedashrafelsaed.com/docs/07-operations.md): Running the Aletheia (aletheia-mem) server: requirements, a systemd user service, the security model, file growth and troubleshooting.

## Release notes

- [Aletheia 0.1.12 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.12.md): Aletheia (aletheia-mem) 0.1.12, released 2026-11-01: 2 added, 3 changed. The release workflow now publishes to the official MCP registry on every tag: it bumps server.json...
- [Aletheia 0.1.11 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.11.md): Aletheia (aletheia-mem) 0.1.11, released 2026-10-30: 4 added, 2 changed, 7 fixed. A full documentation site: 49 pages in eight sections (Get started, Concepts, Connect...
- [Aletheia 0.1.10 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.10.md): Aletheia (aletheia-mem) 0.1.10, released 2026-10-29: 1 added, 3 changed. A Home page, now the default. It lists the projects you work in and, for one project, shows in...
- [Aletheia 0.1.9 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.9.md): Aletheia (aletheia-mem) 0.1.9, released 2026-10-28: 2 added, 2 changed. A context.facts setting (auto, on, off, default auto) that controls which facts the session-start...
- [Aletheia 0.1.8 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.8.md): Aletheia (aletheia-mem) 0.1.8, released 2026-10-28: 2 added, 1 fixed, 5 changed. aletheia facts clean --dry-run (the default) and aletheia facts clean --apply. The command...
- [Aletheia 0.1.7 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.7.md): Aletheia (aletheia-mem) 0.1.7, released 2026-10-28: 2 added, 1 fixed, 1 changed. A recall and latency regression gate runs in CI on Linux: it fails a change that loses...
- [Aletheia 0.1.6 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.6.md): Aletheia (aletheia-mem) 0.1.6, released 2026-10-28: 2 fixed, 1 changed. The MCP initialize reply and GET /v1/info reported version 0.1.0 whatever the installed version....
- [Aletheia 0.1.5 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.5.md): Aletheia (aletheia-mem) 0.1.5, released 2026-10-28: 2 changed. A rule flagged for re-check now carries its reason and "Verify before applying." into synced rules files and...
- [Aletheia 0.1.4 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.4.md): Aletheia (aletheia-mem) 0.1.4, released 2026-10-28: 10 added, 4 changed. A graph retrieval channel and entity pages, off by default behind a flag. On a synthetic test it...
- [Aletheia 0.1.3 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.3.md): Aletheia (aletheia-mem) 0.1.3, released 2026-10-27: 9 added, 2 changed. GET /v1/facts and the fact_history MCP tool: how a fact changed over time.
- [Aletheia 0.1.2 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.2.md): Aletheia (aletheia-mem) 0.1.2, released 2026-10-27: 2 changed. The npm package now ships code and licence files only. Version 0.1.1 also shipped the whole docs/ tree by...
- [Aletheia 0.1.1 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.1.md): Aletheia (aletheia-mem) 0.1.1, released 2026-10-27 and later yanked: 3 added, 1 changed. docs/releasing.md: versioning policy, the release sequence with the owner-only...
- [Aletheia 0.1.0 release notes](https://aletheia.mohamedashrafelsaed.com/docs/releases/v0.1.0.md): Aletheia (aletheia-mem) 0.1.0, released 2026-10-27: 5 added. Generated comparison, tool-support and measured-number tables. scripts/gen-tables.mjs --check fails when a

## Optional

- [README](https://github.com/mohamed-ashraf-elsaed/aletheia-mem/blob/main/README.md): install, status and limits
- [Changelog](https://aletheia.mohamedashrafelsaed.com/docs/changelog.html): release notes, generated from CHANGELOG.md
- [Release feed](https://aletheia.mohamedashrafelsaed.com/docs/releases/feed.xml): Atom feed of new releases
- [Full text of every page](https://aletheia.mohamedashrafelsaed.com/llms-full.txt): all documentation in one file
