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 automatically — injected into the system prompt before every LLM call, with semantically relevant memories refreshed on every turn.

The agent simply remembers.

Memory Cycle Diagramarchitectureprogresstech-contextConversationExtractEmbedStore[MEMORY]injected into system prompt ◄

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 locally in a SQLite database on your machine — no external dependencies, multi-agent safe.

Before every LLM call, 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 — the only section updated on every single turn
Relevant to Current TaskLive per turn

The only section in the [MEMORY] block that re-runs on every single turn. All other sections — Project Brief, Architecture, Tech Context, etc. — are loaded fresh from the database at session start, then cached for the session. This section runs a fresh semantic search against your current message each time, so the right memories surface as topics shift mid-session.

  • Per-turn re-search — as topics shift mid-session, different memories surface automatically without any action from you or your agent.
  • Cross-scope — merges project-scoped and user-scoped memories in a single ranked list by cosine similarity.
  • Confidence-scored + source-traced — each match shows a [82%] similarity score, and high-confidence matches include the source conversation snippet.

This block is rebuilt on every LLM call.

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.

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

curl -fsSL https://codexfi.com/install | bash

This installs Bun if needed, 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