The coding agent that remembers your repo.
Most coding agents start every session from zero. memcode keeps a persistent model of your repo in .memcode
: the subsystems, what you worked on last week, which approaches failed and why, and the preferences you have corrected it on. The longer you use it, the less you have to explain.
One Go binary, a full terminal UI, and it runs against whatever models you already have: the hosted memcode gateway, your own API keys, or a local endpoint like Ollama.
Remembers your repo | Version-control-friendly state in .memcode that survives sessions and machines. Searchable session history. Repeated failures distill into lessons that resurface when they matter. Honors MEMCODE.md , AGENTS.md , and CLAUDE.md instructions, and compresses oversized ones once instead of re-reading them forever. |
Model policy in the client | Automatic mode routes each call by what the turn needs: cheap models for routine work, strong models for planning, review, high-risk changes, and recovery after its own mistakes. Pin any model with /model . Failures walk catalog-defined fallback chains. See
|
Bring your own models | Works with no account: point it at any OpenAI-compatible endpoint. Provider-native APIs get full fidelity, the Responses API on api.openai.com, Messages on api.anthropic.com, Gemini and xAI likewise. Standard key env vars are picked up automatically. |
Reads the room | Tracks the working mood of the session. When you are correcting it, it stops cutting corners, spends more on the model, and asks before acting. When things are calm it stays out of the way. |
A real terminal UI | Multiline editing, slash commands with autocomplete, streaming tool output, interrupt and redirect mid-turn, themes, and a live context meter. |
Plans before it builds | /plan researches with parallel scouts, drafts, gets a cross-model review, and turns the approved plan into a binding contract for execution. |
Delegates and parallelizes | Spawn read-only explorers or full sub-agents, run detached background jobs, and manage them with /jobs , /tail , /kill . |
Table stakes, done properly | MCP client, Agent Skills, hooks (
|
Self-updatingMEMCODE_AUTO_UPDATE=off
keeps it manual.
curl -fsSL https://memcode.ai/install.sh | sh
Or with Go:
go install github.com/memcode-ai/memcode@latest
Or build from source:
git clone https://github.com/memcode-ai/memcode
cd memcode && go build -o memcode .
Then run memcode
in a repo.
MEMCODE_ENDPOINT_URL=http://localhost:11434/v1 memcode # Ollama, local
MEMCODE_ENDPOINT_URL=https://api.openai.com/v1 memcode # your OpenAI key (OPENAI_API_KEY)
MEMCODE_ENDPOINT_URL=https://api.anthropic.com memcode # your Anthropic key (ANTHROPIC_API_KEY)
OPENAI_API_KEY
, ANTHROPIC_API_KEY
, GEMINI_API_KEY
, XAI_API_KEY
, FIREWORKS_API_KEY
, and friends are picked up automatically for their hosts. Named endpoints live in config, and /model
switches models mid-session.
With a memcode account you get one balance across every vendor, a key vault for BYOK, and hosted web search:
memcode login
The whole product is in this repo, gateway included, and the gateway is a single stateless binary:
cd deploy/docker && cp ../../.example.env .env # set a token + a provider key
docker compose up --build
See docs/self-hosting.md. The hosted service at memcode.ai runs this same code with a private control plane on top (accounts, one balance across vendors, the BYOK vault, team features).
The CLI is the agent: all model selection, escalation, and recovery run client-side; every backend is a plain serving surface speaking one OpenAI-compatible wire (protocol/PROTOCOL.md). The gateway under gateway/
is that serving surface, metered and typed, sharing one provider implementation with the CLI. Cloud-only behavior sits behind one control-plane seam; self-host mode constructs none of it.
MIT. See LICENSE.