How companion-inc/feynman works
Feynman is an AI research agent and local science workbench. A user invokes the CLI with a research, ranking, paper, replication, recipe, or server command. CLI dispatches into Pi-backed model execution and research tools, which query scientific sources, normalize evidence, and return cited results. The optional workbench serves projects, chat, artifacts, notebooks, compute, and review through a local HTTP server and web UI, persisting state in an org SQLite database. The graph emphasizes sampled runtime paths; many individual database connectors are represented by their shared registries.
Main entry points: server.ts Workbench Server · research-tools.ts Research Tools · cli.ts CLI Entry · commands.ts Command Routing
Components 23
Entry and Commands
- CLI Entry
src/cli.ts - Command Routing
src/model/commands.ts
Research and Evidence
- Research Tools
extensions/research-tools.ts - Science Databases
extensions/research-tools/science-databases.ts - Variant Sources
extensions/research-tools/science-database-variants.ts - PubMed Parser
extensions/research-tools/science-database-pubmed-parsers.ts - Web Search
src/web-search.ts - PaperRank
src/rank/paper-rank.ts
Model Runtime
- Pi Runtime
src/pi/runtime.ts - Pi Launcher
src/pi/launch.ts - Model Catalog
src/model/catalog.ts
Science Workbench
- Workbench Server
src/workbench/server.ts - Workbench UI
workbench-web/src/main.tsx - Chat Runtime
src/workbench/chat-runtime.ts - Notebook Execution
src/workbench/notebook-execution.ts - Artifact Actions
src/workbench/artifact-actions.ts
State and Integrations
- Workbench Database
src/workbench/org-database.ts - Settings Store
src/workbench/settings-store.ts - OAuth Store
src/workbench/oauth-store.ts
Other components
- Researcher
- Science APIs
- Model Providers
- Local Files
Connections 27
- Researcher → CLI Entry: invokes
- CLI Entry → Command Routing: dispatches
- Command Routing → Research Tools: runs research
- Command Routing → PaperRank: runs ranking
- Command Routing → Web Search: runs search
- Research Tools → Science Databases: selects sources
- Science Databases → Variant Sources: dispatches variants
- Variant Sources → Science APIs: queries variants
- Research Tools → PubMed Parser: parses papers
- Research Tools → Science APIs: queries science
- Web Search → Science APIs: fetches evidence
- PaperRank → Research Tools: collects evidence
- CLI Entry → Pi Launcher: starts agent
- Pi Launcher → Pi Runtime: launches runtime
- Pi Runtime → Model Catalog: resolves model
- Pi Runtime → Model Providers: calls models
- CLI Entry → Workbench Server: serves workbench
- Workbench UI → Workbench Server: calls API
- Workbench Server → Chat Runtime: submits chat
- Workbench Server → Notebook Execution: executes cells
- Workbench Server → Artifact Actions: handles artifacts
- Workbench Server → Settings Store: reads settings
- Workbench Server → OAuth Store: finishes OAuth
- Chat Runtime → Pi Runtime: runs agent
- Artifact Actions → Local Files: reads artifacts
- Workbench Server → Workbench Database: serves state
- Workbench Database → Local Files: persists state