Feynman AI Research Agent

repository·main·Indexed 27 days ago

https://github.com/companion-inc/feynman

An open-source AI research agent built on Pi and alphaXiv designed to automate literature reviews, paper ranking, replication planning, and scientific synthesis. It features a CLI and a standalone 'science workbench' with specialized workflows for deep research, codebase auditing, and hypothesis-driven optimization loops via the autoresearch command.

Tokens
38.9K
Snippets
84
Records
237
Agent score
93%

What's inside Feynman

  1. Overview of Workbench Features

    main

    The Science Workbench provides a comprehensive suite of research tools:

    • Projects and Sessions: Manage research projects, open existing sessions, and maintain Pi-backed chat metadata.
    • Feynman Bio Tools: Access a wide array of science connectors for literature (OpenAlex, arXiv, PubMed), chemistry (PubChem, ChEBI, Ketcher), genomics (Ensembl, MyGene, UniProt), and various omics/pathway databases.
    • Artifacts and Previews: Browse and preview diverse file types including Jupyter notebooks, LaTeX, chemistry artifacts (SMILES, SDF, etc.), proteins, alignments, and tensors. Supports HTML report annotation with selector/text capture.
    • Notebooks and Compute: Execute Python, R, and Bash cells, inspect session kernels, and manage compute providers and jobs.
    • Versions and Lineage: Inspect artifact versions, checksums, producer records, and execution evidence.
    • Settings and Resources: Manage specialists, skills, permissions, compute, network, storage, and credentials (viewing redacted availability without exposing raw secrets).
  2. Understand the Feynman directory structure

    main

    Feynman stores user-level configuration and state in ~/.feynman/. This directory is created on the first run and contains settings, authentication metadata, session history, and workspace data.

    Key directories include:

    • agent/settings.json: Primary configuration file for models and runtime.
    • agent/auth.json: Provider authentication metadata and API keys.
    • agent/agents/: Synced subagent prompts (includes model overrides).
    • sessions/: Persisted conversation history.
    • memory/: Feynman memory storage.
    • web-search.json: Web-search routing configuration.
    • bin/: Command shim used by child agents.
  3. Register or audit Managed Model Endpoints

    main

    Use the managed-model-endpoints skill to make a model endpoint usable within Feynman. This is intended for research workflows that require local or remote model services, endpoint health checks, credential references, startup scripts, or inference routing.

    Implementation Workflow

    1. Define Endpoint Specifications: Determine the endpoint purpose, model family, input/output schema, authentication method, hardware requirements, and expected latency.
    2. Identify Endpoint Type: Categorize the endpoint as local, remote HTTP, Modal-backed, SSH-backed, or a custom connector.
    3. Configure Metadata and Secrets:
      • Add non-secret endpoint metadata directly to settings.
      • Do not store secrets in settings. Store secret references as environment variable names or credential references.
    4. Lifecycle Management: If Feynman is responsible for the endpoint lifecycle, implement the following checks:
      • start
      • stop
      • health
      • inference
    5. Validation: Perform a small inference smoke test and save the request/response shape, ensuring no secrets are leaked in the saved data.

    Best Practices

    Expose endpoints as research infrastructure. Do not treat an endpoint as a permanent installation claim until health checks have successfully passed.

  4. Update Feynman

    main

    Standalone App

    To update the standalone Feynman app on macOS, Linux, or Windows, rerun the original installer command used during installation. This replaces the runtime bundle with the latest tagged release.

    Note: feynman update is used to update installed Pi packages inside the environment, not the app bundle itself.

    npm Installation

    If installed via npm, upgrade using:

    npm install -g @companion-ai/feynman@latest
  5. Onboard to the Science Workbench

    main
    Running feynman serve initiates a local onboarding flow for the science workbench. This flow automates the creation of a Feynman project and session, captures research context, suggests specialists and workflows, and enables connectors like Feynman Bio Tools if science-database access is selected. Setup intent and redacted credential availability are stored in Feynman-owned state.
    feynman serve
  6. Install Feynman Skills only

    main

    If you only want Feynman's research skills (the skills/ and prompts/ trees) without the full terminal runtime, bundled Node runtime, or auth storage, use the skills installer.

    macOS or Linux

    • Codex install (~/.codex/skills/feynman):
      curl -fsSL https://feynman.is/install-skills | bash
      # Or explicitly:
      curl -fsSL https://feynman.is/install-skills | bash -s -- --codex
    • Repo-local Claude/agent install (.agents/skills/feynman):
      curl -fsSL https://feynman.is/install-skills | bash -s -- --repo
    • OpenCode project-local install (.opencode/skills/feynman):
      curl -fsSL https://feynman.is/install-skills | bash -s -- --opencode

    Windows (PowerShell)

    • Codex install:
      irm https://feynman.is/install-skills.ps1 | iex
      # Or explicitly:
      & ([scriptblock]::Create((irm https://feynman.is/install-skills.ps1))) -Scope Codex
    • Repo-local install:
      & ([scriptblock]::Create((irm https://feynman.is/install-skills.ps1))) -Scope Repo
    • OpenCode install:
      & ([scriptblock]::Create((irm https://feynman.is/install-skills.ps1))) -Scope OpenCode
    curl -fsSL https://feynman.is/install-skills | bash
  7. Run the Autoresearch workflow

    main

    Use the /autoresearch slash command to initiate a bounded research experiment loop. This workflow is designed to test hypotheses, measure benchmark evidence, retain successful approaches, and record failures.

    Use this workflow when you need to:

    • Optimize a research metric.
    • Run an iterative experiment loop.
    • Improve model, retrieval, or evaluation performance.
    • Benchmark a specific research hypothesis.

    Note: Do not attempt to read relative prompt-template paths from the installed skill directory. Instead, use the slash command which expands the full workflow instructions directly in the active session.

    /autoresearch
  8. Use the indication-dossier skill to build biomedical evidence packets

    main

    The indication-dossier skill is used to assemble a source-backed biomedical evidence packet for a disease, target, mechanism, biomarker, or therapy. This is ideal for research tasks involving disease biology, target rationale, patient segmentation, biomarkers, clinical trials, drugs, competitive landscape, or translational evidence.

    Workflow

    1. Define Scope: Specify the indication, patient segment, intervention or target, and the specific decision the dossier must support.
    2. Gather Evidence: Collect data from literature, clinical trials, Open Targets, ChEMBL, CIViC, ClinGen, cBioPortal, DepMap/COSMIC-compatible sources, and other Feynman Bio Tools.
    3. Categorize Evidence: Organize findings into distinct sections: human evidence, model-system evidence, mechanism, biomarkers, clinical precedent, safety, and open questions.
    4. Evaluate Claims: Rank claims based on source strength and reproducibility. Explicitly flag missing cohorts, potential confounders, and assay limitations.
    5. Export: Save the completed dossier and its accompanying provenance sidecar to the outputs/ directory.

    Constraint: Do not convert sparse evidence into clinical recommendations.

  9. Execute OpenFold3-style structure prediction workflows

    main

    Use the openfold3 skill when a task requires OpenFold-family structure prediction, setup, model comparison, or ensuring reproducibility for OpenFold-family outputs.

    Follow this workflow for successful execution:

    1. Normalize Inputs: Ensure FASTA, chains, templates, MSAs, ligands/partners, seeds, and the expected output format are normalized.
    2. Verify Environment: Before execution, verify the model code, checkpoints, databases, and the GPU route.
    3. Capture Provenance: Save the input manifest, environment lockfile, command, logs, structure outputs, confidence files, and runtime metadata.
    4. Compare Results: When results affect decisions, compare them against AlphaFold-style, ESMFold-style, PDB, or literature evidence.
    5. Report Gaps: Explicitly report reproducibility gaps such as missing databases, unavailable weights, failed templates, or route-specific approximations.

    Important: Never present an OpenFold-family output without specifying the version and input provenance.

  10. Install Feynman research skills only

    main

    If you do not want the full terminal app and only need the research skills library, use the install-skills installer. This installs the skills/ and prompts/ trees into a specific target directory.

    macOS / Linux

    curl -fsSL https://feynman.is/install-skills | bash

    Windows (PowerShell)

    irm https://feynman.is/install-skills.ps1 | iex