ScriptsJun 2, 2026·3 min read

Feynman — Companion Agent Brain for Persistent Context

A context engine that gives AI coding agents persistent memory and reasoning capabilities, enabling them to maintain understanding across long sessions and complex multi-file tasks.

Agent ready

Review-first install path

This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.

Needs Confirmation · 66/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Feynman Overview
Review-first command
npx -y tokrepo@latest install 6f4d1b7b-5e7d-11f1-9bc6-00163e2b0d79 --target codex

Dry-run first, confirm the writes, then run this command.

Introduction

Feynman acts as a persistent context brain for AI coding agents. Named after the physicist known for deep understanding, it indexes your codebase, tracks conversation history, and provides structured context retrieval so agents maintain coherence across long development sessions without losing track of decisions made earlier.

What Feynman Does

  • Indexes codebases into a searchable knowledge graph
  • Maintains persistent session memory across agent restarts
  • Provides context-aware retrieval for coding agent queries
  • Tracks architectural decisions and rationale over time
  • Integrates with multiple agent frameworks via a standard API

Architecture Overview

Feynman runs as a local TypeScript server that watches your project directory. It builds an incremental index using AST parsing and embedding-based chunking, stored in a local SQLite database. When an agent queries for context, Feynman performs hybrid search (keyword + semantic) and returns ranked results with source locations. A decision log captures agent reasoning chains for future reference.

Self-Hosting & Configuration

  • Requires Node.js 18+ and runs as a local daemon
  • Configure via feynman.config.json for index scope, ignored paths, and model preferences
  • Supports local embeddings via Ollama or cloud providers for embedding generation
  • Stores all data locally in .feynman/ directory within your project
  • Resource usage scales with codebase size; typical projects use under 500MB of disk

Key Features

  • Incremental codebase indexing with AST-aware chunking
  • Hybrid search combining keyword matching and semantic similarity
  • Decision log that preserves architectural reasoning across sessions
  • Agent-agnostic REST API compatible with any tool-use protocol
  • Offline-capable with local embedding models

Comparison with Similar Tools

  • Cody by Sourcegraph — cloud-hosted code context; Feynman is local-first and agent-agnostic
  • Cursor codebase indexing — IDE-specific; Feynman works with any agent or editor
  • RAGFlow — document-oriented RAG; Feynman is purpose-built for code context
  • Continue — IDE assistant; Feynman is a standalone context layer, not an agent itself

FAQ

Q: Does Feynman work with any coding agent? A: Yes, it exposes a REST API that any agent can call for context retrieval. Adapters exist for popular frameworks.

Q: How large a codebase can it handle? A: Feynman has been tested on repositories with over 100,000 files. Indexing is incremental, so only changed files are re-processed.

Q: Does it require a GPU? A: No. Local embeddings run on CPU via Ollama. GPU acceleration is optional and improves indexing speed for large repos.

Q: Where is the data stored? A: All index data stays in a .feynman/ directory inside your project. Nothing leaves your machine unless you configure a cloud embedding provider.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets