repobrain

study8677MIT活跃维护

给代码仓库装上大脑的代码智能问答工具,能接入 Claude Code、Cursor、Codex 等 IDE 和命令行,用知识图谱检索帮你快速理解和查询整个代码库。

🧠 RepoBrain (formerly Antigravity) — Give your repo a brain. ChatGPT for your codebase: works in Claude Code, Cursor, Codex, Windsurf & more.

v0.3.1发布于 2026-07-10 03:21 UTC1,361star +1 / 7 天262fork同步于 2026-11-10 11:48 UTC

怎么上手

由 README 提炼,执行前请确认
rb-refresh
rb-ask "How does authentication work in this project?"
硬件要求按 README 说明

README 未说明显存或 GPU 要求;需 Python 3.10+、Git 且仓库至少有一次提交,模型后端可用已登录的无头 CLI 或 OpenAI 兼容 API。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

给代码库装个大脑,让 AI 编程工具基于真实源码回答仓库问题

给代码仓库装上大脑的代码智能问答工具,能接入 Claude Code、Cursor、Codex 等 IDE 和命令行,用知识图谱检索帮你快速理解和查询整个代码库。

核心能力

  • 用 rb-refresh 为每个模块生成知识文档并存入 .repobrain/
  • 用 rb-ask 把问题路由到对应模块 Agent 并附文件路径行号
  • 同一份 .repobrain/ 知识层被 Claude Code、Cursor 等 IDE 共享
  • 知识更新分阶段进行,失败时保留上一代可用知识
  • 支持 CLI、JSON 输出与可选 rb-mcp 接入任意宿主

容易踩的坑

安装到已有项目不需要 rb init 或 rb-init;首次构建大仓库可能耗时数分钟并消耗所配置模型;refresh 前需提交或 stash 本地改动以保持工作区干净。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

3 个版本v0.3.1
  1. v0.3.1RepoBrain 0.3.1最新正式版2026-07-10 · 2026-07-10 03:21 UTC

    Highlights:

    • Freshness-aware answers with true incremental and resumable refresh.
    • New rb doctor diagnostics and actionable CLI error handling.
    • Claude plugin now installs and upgrades the rb CLI and engine together.
    • Clean-room fresh-install and v0.3.0 upgrade checks now run in CI.
    • Runtime changes after a release tag now require version bumps.

    Versions: engine/plugins 0.3.1, CLI 2.0.1.

  2. v0.3.0RepoBrain 0.3.02026-07-09 · 2026-07-09 08:21 UTC
    查看更新说明

    Antigravity is now RepoBrain 🧠 — same engine, new name. The repository moved to study8677/repobrain (old URLs redirect automatically).

    ⚠️ Breaking changes

    This is a clean-break rename. All functional identifiers changed:

    BeforeAfter
    ag / ag-ask / ag-refresh / ag-mcprb / rb-ask / rb-refresh / rb-mcp
    AG_* environment variablesRB_* (e.g. RB_ASK_TIMEOUT_SECONDS)
    .antigravity/ knowledge directory.repobrain/
    antigravity-engine / antigravity_enginerepobrain-engine / repobrain_engine
    antigravity-cli / ag_clirepobrain-cli / rb_cli (CLI v2.0.0)
    /plugin install antigravity@antigravity/plugin install repobrain@repobrain
    /antigravity:ag-* slash commands/repobrain:rb-*

    Migration

    1. Reinstall: pipx install "git+https://github.com/study8677/repobrain.git#subdirectory=engine" (or reinstall the plugin)
    2. Update .env: rename AG_* keys to RB_*
    3. Re-run rb-refresh --workspace . (old .antigravity/ folders are ignored and can be deleted)

    ✨ New since 0.2.1

    • Local Codex host-runner mode: RB_HOST_RUNNER=codex lets rb-ask run through your local codex login — no API key required (ask-only, experimental)
    • Scan-only refresh: RB_REFRESH_SCAN_ONLY=1 builds scan artifacts without an LLM provider
    • New brand assets: vector logo and before/after graphic

    Verification

    • 251 engine + CLI tests pass on Python 3.10/3.11/3.12
    • Repository contract check passes
  3. v0.2.1Antigravity 0.2.12026-04-29 · 2026-04-29 14:54 UTC
    查看更新说明

    Stage 1 hotfix release.\n\nHighlights:\n- Claude plugin MCP registration uses bundled .mcp.json and plugin-prefixed tool names.\n- ag-mcp reports version 0.2.1 and installer upgrades stale engines.\n- First refresh initializes .antigravity automatically.\n- MCP startup/tool errors are logged privately with secret redaction.\n\nVerification: engine test suite passed locally (172 passed, 1 requests dependency warning).


    Note: the project was renamed to RepoBrain in v0.3.0. The ag-* commands, AG_* env vars, and .antigravity/ directory mentioned above apply to this version only.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    RepoBrain

    Cross-IDE repository knowledge engine for grounded codebase Q&A.

    Formerly known as Antigravity Workspace Template — same project, new name.

    English · 中文 · Español

    License Python CI DeepWiki NLPM Stars

    RepoBrain helps you understand an unfamiliar repository, trace an implementation, and ask questions with source-file references. It keeps project knowledge in .repobrain/, shared across supported IDEs and agents.

    Project Philosophy

    Cross-IDE repository knowledge engine for grounded codebase Q&A. Same .repobrain/ knowledge layer reads in every IDE; one engine, every host.

    An AI Agent's capability ceiling = the quality of context it can read.

    rb-refresh deploys a multi-agent cluster that autonomously reads your code — each module gets its own Agent that generates a knowledge doc. rb-ask routes questions to the right Agent, grounded in real code with file paths and line numbers.

    Instead of handing Claude Code / Codex a repo-wide grep and making it hunt on its own, give it a ChatGPT for your repository.

    Traditional approach:              RepoBrain approach:
      CLAUDE.md = 5000 lines of docs     Claude Code calls ask_project("how does auth work?")
      Agent reads it all, forgets most   Router → ModuleAgent reads actual source, returns exact answer
      Hallucination rate stays high      Grounded in real code, file paths, and git history
    
    ProblemWithout RepoBrainWith RepoBrain
    Agent forgets coding styleRepeats the same correctionsReads .repobrain/conventions.md — gets it right the first time
    Onboarding a new codebaseAgent guesses at architecturerb-refresh → ModuleAgents self-learn each module
    Switching between IDEsDifferent rules everywhereOne .repobrain/ folder — every IDE reads it
    Asking "how does X work?"Agent reads random filesask_project MCP → Router routes to the responsible ModuleAgent

    Architecture is files + a live Q&A engine, not plugins. Portable across any IDE, any LLM, zero vendor lock-in.

    Read the full project philosophy.

    Quick Start

    Ask an AI assistant that can run commands in your project to install RepoBrain:

    Read AI_INSTALL.md and follow it to install RepoBrain in this project.

    The guide installs the tools, configures a model backend, then builds the knowledge base and checks an answer. A logged-in headless CLI such as Trae can serve as the backend without an API key; an OpenAI-compatible API is also supported. Requirements: Python 3.10+, Git with at least one commit, and a clean worktree before refresh.

    For platform-specific installation or manual configuration, see the installation guide and the quick-start guide. Installing RepoBrain into an existing project does not require rb init or rb-init.

    Everyday Use

    Run these commands in your project directory after installation and configuration:

    rb-refresh
    rb-ask "How does authentication work in this project?"
    

    rb-refresh automatically builds the first knowledge base, updates affected groups after committed changes, or continues a matching interrupted task. If knowledge is already current, it skips without calling a model. After a failure, run the same command again to continue.

    Use this only when you want to regenerate all knowledge:

    rb-refresh --full
    

    rb-ask reads the existing knowledge base and answers with source evidence. It reminds you when committed code is newer; it does not refresh during a question.

    Examples of useful questions:

    • Where is this API implemented, and what calls it?
    • How does data move from the UI to the backend?
    • Which modules are affected by changing this function?

    How It Works

    Source code → rb-refresh → .repobrain/ knowledge → rb-ask → answer with code references
    

    RepoBrain groups related code, generates module knowledge, and routes each question to relevant context. Knowledge lives in your project, so supported IDEs share the same base. Updates are staged separately and become active only when complete; a failed update preserves the existing usable generation.

    The first build can take several minutes or longer on large repositories and uses your configured model. Commit or stash local changes before refreshing. IDE rules and new-project scaffolding are optional; see the usage reference.

    Support Matrix

    UseEnvironmentsHow to connect
    Native pluginsClaude Code, Codex CLISetup, refresh, and ask via slash commands.
    Compatible IDEsCursor, Windsurf, Gemini CLI, VS Code + Copilot, Cline, Aider, DeepSeek HarnessShared context files, CLI, or an MCP client.
    Other agents and scriptsAny host that can run commands or call MCP toolsCLI/JSON output or optional rb-mcp.

    Platform-specific commands, JSON output, and MCP registration are documented in the usage reference and INSTALL.md.

    Evaluation

    A locked comparison on Flask, ripgrep, Vite, and Prometheus used the same source access and model route for RepoBrain and CodeGraph + Trae. The full report includes accuracy, query time, tokens, and cold-build cost. Results apply to that experiment; AI knowledge generation and static graph indexing are different workloads.

    Documentation

    NLPM Audit Feedback — Improved by NLPM, a natural-language programming linter by xiaolai.


    Contributing

    Ideas are contributions too! Open an issue to report bugs, suggest features, or propose architecture.

    Contributors

    Star History

    Star History Chart

    License

    MIT License. See LICENSE for details.


    📚 Full Documentation →

    Built for the AI-native development era

    Friendly Link: LINUX DO