Memory Layer is a local knowledge base built first for coding agents such as Codex CLI and Claude Code, while still working well for normal developers.
It captures durable project knowledge, stores it in PostgreSQL with pgvector, and makes it searchable in a TUI or browser so important context does not disappear into chat history, terminal scrollback, or old commits.
It supports multiple developers, multiple projects, and multiple coding agents at the same time through a distributed watcher system and a shared memory backend.
The fastest path is:
- Install the package.
- Run
memory wizard --globalonce per machine. - Run
memory wizardinside each repository. - Let Memory Layer auto-derive a writer identity, or set
writer.idonly if you want a custom shared label. - Start
memory service runor enable the packaged service. - Open the TUI or web UI.
Debian:
sudo dpkg -i memory-layer_<version>_amd64.deb
memory wizard --global
cd /path/to/your-project
memory wizard
sudo systemctl enable --now memory-layer.service
memory tuimacOS:
brew tap 3vilM33pl3/memory https://github.com/3vilM33pl3/memory
brew install --HEAD 3vilM33pl3/memory/memory-layer
memory wizard --global
cd /path/to/your-project
memory wizard
memory service enable
memory tuiFor the full onboarding flow, prerequisites, upgrade path, and troubleshooting, use Getting Started.
For semantic-search maintenance and model switching, use Embedding Operations.
For shareable backup/restore bundles, use Memory Bundles.
For watcher health states, recovery behavior, and the TUI watcher views, use Watcher Health.
For bootstrap, diagnostics, and the main write path, use Wizard And Bootstrap, Service Commands, Doctor Diagnostics, and Remember Command.
Most mutating memory commands support --dry-run so you can preview writes, service actions, and plan/checkpoint flows before applying them.
For a visual walkthrough of the interface, use the TUI Guide.
If you are working on Memory Layer itself, you can run a development copy from a cargo checkout that is fully isolated from any packaged install on the same machine — separate ports, separate Cap'n Proto socket, separate runtime directory. The TUI shows [dev] in its header so you cannot mistake one for the other.
The mechanism: any memory binary launched from target/{debug,release}/ activates the dev profile, which layers .mem/config.dev.toml on top of .mem/config.toml and ignores the global config entirely. Override with MEMORY_LAYER_PROFILE=dev|prod when needed.
git clone https://github.com/3vilM33pl3/memory
cd memory
npm --prefix web ci && npm --prefix web run build
# Bootstrap the repo-local base config and the dev overlay.
cargo run --bin memory -- init
cargo run --bin memory -- dev init --copy-from-global
# Each piece in its own shell, all on the dev stack.
cargo run --bin memory -- service run # backend (4250 HTTP, 4251 capnp)
cargo run --bin memory -- watcher manager run # optional
cargo run --bin memory -- tui # header reads [dev]--copy-from-global lifts the database URL and LLM/embedding endpoints from the installed config into the dev overlay so credentials are not duplicated.
| Stack | HTTP | capnp TCP | capnp Unix socket |
|---|---|---|---|
| Installed (Debian/Homebrew package) | 127.0.0.1:4040 |
127.0.0.1:4041 |
/tmp/memory-layer.capnp.sock |
| Dev (cargo-run from repo) | 127.0.0.1:4250 |
127.0.0.1:4251 |
<repo>/.mem/runtime/dev/memory-layer.capnp.sock |
For the full isolation contract, override flags, troubleshooting, and the verification recipe, see Dev Stack vs Installed Stack.
- stores project memory in PostgreSQL with pgvector-backed chunk embeddings
- supports both primary and relay service modes
- keeps memory scoped per project while supporting multiple developers, writers, and agents
- captures raw evidence and curates durable memory from it
- combines lexical search, vector search, and related-memory links
- supports re-embedding when you switch embedding models without losing older embedding spaces
- uses distributed watchers to track active projects and feed evidence into the shared memory system
- provides a TUI and a browser UI
- can scan a repository for durable project knowledge
- can import git commit history as searchable evidence
- can export and import shareable project memory bundles
Project-local customization now has two layers:
.mem/for runtime overrides and generated state.agents/memory-layer.tomlfor project-owned memory behavior such as include/ignore paths and future analyzers/plugins
- User Documentation Index
- Getting Started
- TUI Guide
- Embedding Operations
- Memory Bundles
- Watcher Health
- Resume Briefings
- Wizard And Bootstrap
- Init Bootstrap
- Service Commands
- Doctor Diagnostics
- Health And Stats
- Query Command
- Checkpoint Workflow
- Capture Command
- Remember Command
- Curate Command
- Repository Index
- Scan Command
- Commit History
- Archive Command
- Automation Commands
- Developer Documentation Index
- Dev Stack vs Installed Stack
- How Skills Work
- Architecture Overview
- How Memory Layer Works
- Hidden Memory Daemon
Memory Layer is dual-licensed:
- Open source: GNU Affero General Public License v3.0 or later, see LICENSE
- Commercial: available under a separate commercial license from the copyright holder, see LICENSE-COMMERCIAL.md
If you use, modify, or host Memory Layer under the open source license, you must comply with the AGPL, including providing source code for modified networked versions.
If you want to use Memory Layer in a proprietary or closed-source commercial setting, contact the copyright holder for a commercial license.
Unless explicitly agreed otherwise in writing, contributions are accepted under the repository's open source license, while the maintainer retains the right to offer the project under separate commercial terms. See CONTRIBUTING.md.
For working on this repository itself, start with Quick Start (Developers) above and then Dev Stack vs Installed Stack for the isolation contract.
Packaging, architecture, and implementation details live under Developer Documentation.
