codexfi

What is codexfi?

codexfi is a plugin for OpenCode that gives your AI coding agent persistent memory across sessions. Architecture decisions, tech stack context, progress tracking, error solutions, user preferences — everything is automatically extracted from conversations, stored locally, and retrieved at the start of every new session.

The agent simply remembers.

How it works

After every assistant turn, codexfi analyzes the conversation and extracts key facts as typed memories. Each memory is embedded with Voyage AI (voyage-code-3) and stored in an embedded LanceDB database on your machine.

At the start of every session, a [MEMORY] block is injected into the system prompt containing:

  • Project Brief — what the project is and its goals
  • Architecture — system design and component relationships
  • Tech Context — stack, tools, build commands
  • Product Context — why the project exists, problems solved
  • Progress & Status — current state of work
  • Last Session — summary of the previous conversation
  • User Preferences — cross-project personal preferences
  • Relevant to Current Task — semantically matched memories for the current topic

This block is rebuilt on every LLM call. As the conversation shifts topics, different memories surface automatically.

Key features

  • Fully automatic — memories save after every assistant turn with zero user action
  • Self-hosted — all data stays on your machine; no cloud, no Docker, no separate server
  • Code-optimized embeddings — Voyage voyage-code-3 (1024 dimensions), purpose-built for code
  • Multi-provider extraction — Anthropic Claude Haiku (default), xAI Grok (fastest), Google Gemini (native JSON)
  • Typed memory system — 11 memory types for structured knowledge organization
  • Smart deduplication — cosine similarity prevents storing duplicate memories
  • Relational versioning — contradicting memories are automatically superseded
  • Compaction-proof — memory lives in the system prompt, surviving context window truncation
  • Privacy filter — wrap content in <private>...</private> to exclude it from extraction

Quick start

bunx codexfi install

This registers the plugin with OpenCode, prompts for API keys, and creates the /memory-init slash command. Restart OpenCode, and the agent starts remembering.

See the Installation guide for detailed setup instructions.

Requirements

Next steps

On this page