Repomemory

io.github.DanielGuru由 GitHub 账号 DanielGuru 发布v1.3.0更新于 Oct 24, 2026

Persistent memory for AI coding agents. Hybrid search, auto-session capture, context routing.

发布方自己的服务:RepoMemory

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

为 AI 编程代理提供持久、可搜索的项目记忆,通过工具对仓库的 .context 知识库进行搜索、读取、写入和删除。

可以做什么
  • 搜索与定位:在仓库与全局上下文中做关键词加语义的混合搜索,并一次性返回索引、偏好和近期会话的定位信息。
  • 读取与浏览:读取完整条目,优先仓库、回退全局,并按来源标签列出条目。
  • 写入与维护:按作用域路由记录事实、决策、回归问题和偏好,并删除过时知识。
  • 风险评估:针对整个代码库或指定文件报告热点、隐藏耦合和巴士因子。
  • 会话与历史:关闭时自动保存会话摘要,并可将 git 历史同步为变更日志。
适用场景
适合在同一个代码库上跨多次 AI 会话工作时使用,让代理不再重复摸索架构、重复争论已定决策或重新引入已修复的缺陷。也适合希望共享可搜索项目知识、而非依赖静态说明文件的团队。
运行要求
通过 npx 在本地运行(需要 Node.js)。安装命令会向 Claude Code、Cursor、Copilot、Windsurf、Cline、Aider、Continue 等工具写入 MCP 配置和规则。AI 分析需要模型提供商密钥,如 ANTHROPIC_API_KEY、OPENAI_API_KEY、GEMINI_API_KEY 或 GROK_API_KEY;Cursor 方式可不用外部密钥。可选嵌入使用 Gemini 或 OpenAI 密钥。
安装前请注意
工具可写入和删除仓库 .context 目录中的知识条目,安装过程会修改工具配置文件并安装提交后钩子。AI 分析会把仓库内容发送给所选模型提供商,费用计入你的 API 密钥;嵌入也可能发送给 Gemini 或 OpenAI。依赖生成内容前请先审阅。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Repomemory,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

repomemory

Your codebase never forgets.

AI agents lose context every session. repomemory fixes that — one command creates a persistent, searchable knowledge base that any AI tool can read, search, and write to.

[npm version] [npm downloads] [license] [CI]

bash
npx repomemory go

The Problem

Every time you open a project with Claude Code, Cursor, Copilot, or any AI coding agent:

  • It re-discovers your architecture from scratch
  • It proposes changes that were already debated and rejected
  • It re-introduces bugs that were already fixed

Your CLAUDE.md / .cursorrules helps, but it's static and gets stale.

The Solution

.context/├── index.md              ← Quick orientation (loaded every session)├── facts/                ← Architecture, database, deployment├── decisions/            ← "We chose Drizzle over Prisma because..."├── regressions/          ← "This broke before. Here's what happened."├── preferences/          ← Your coding style — follows you across all repos├── sessions/             ← Auto-captured AI session summaries└── changelog/            ← Monthly git history syncs

Facts tell agents how things work. Decisions prevent re-debating. Regressions prevent re-breaking. Preferences teach agents how you code.

Quick Start

With an API key (Claude Code, terminal workflows)

bash
npx repomemory go

One command: sets up global profile, creates .context/, configures Claude Code + Cursor, runs AI analysis, prints CLAUDE.md instructions.

With Cursor (no API key needed)

bash
npx repomemory setup cursor

This installs everything Cursor needs:

  • MCP server in ~/.cursor/mcp.json (auto-starts repomemory in every project)
  • Rules in .cursor/rules/repomemory.mdc (teaches Cursor's AI to use context)
  • 6 commands in .cursor/commands/ (run with / in Cursor chat)

Then in Cursor chat, type:

/repomemory-analyze

Cursor's own AI scans your repo and populates .context/ via the MCP tools. No external API key required — your Cursor subscription handles it.

Available Cursor commands:

CommandWhat it does
/repomemory-analyzeFull repo analysis — populates facts, decisions, index
/repomemory-orientQuick orientation at start of session
/repomemory-searchSearch the knowledge base
/repomemory-recordRecord a fact, decision, or regression
/repomemory-sessionSave a session summary
/repomemory-statusShow context coverage

Guided wizard

bash
npx repomemory wizard

Walks through provider selection, tool integration, and first analysis. If no API keys are detected, offers a "None — I use Cursor" option that skips external analysis entirely.

Non-interactive (CI-safe)

bash
npx repomemory go --yes --provider anthropic --embedding-provider gemini --max-files 80

No prompts when --yes / --defaults / --no-prompt is used.

MCP Server — Agents With Real Memory

The real power is the MCP server. When configured via repomemory setup claude, it auto-starts with Claude Code and gives agents 7 tools:

ToolWhat It Does
context_searchHybrid keyword + semantic search across repo + global context
context_auto_orientOne-call orientation: index, preferences, recent sessions
context_writeWrite entries with smart scope routing (preferences → global)
context_readRead full content, repo-first with global fallback
context_listBrowse entries with [repo]/[global] provenance tags
context_riskAssess modification risk — hotspots, hidden coupling, bus factor
context_deleteRemove stale knowledge
Agent: "Let me orient myself in this project..."→ context_auto_orient()→ Returns: project overview, preferences, recent sessions, recent changes
Agent: "Let me search for context about the auth flow..."→ context_search("authentication flow")→ Auto-routes to facts/ category, returns compact results
Agent: "I found a race condition. Let me record this."→ context_write(category="regressions", filename="token-refresh-race", content="...")→ Persisted. Detects if it supersedes an existing entry.

Sessions are auto-captured on shutdown. Zero config — repomemory setup claude handles everything.

Supported Tools

ToolIntegrationAPI Key Required?
Claude CodeMCP server (auto-starts) + post-commit hookYes (for analysis)
CursorMCP server + rules + 6 slash commandsNo — uses Cursor's built-in AI
GitHub Copilotcopilot-instructions.mdYes (for analysis)
Windsurf.windsurfrulesYes (for analysis)
Cline.clinerulesYes (for analysis)
Aider.aider.conf.ymlYes (for analysis)
Continue.continue/rules/Yes (for analysis)

Cursor users: You don't need any API key. Run npx repomemory setup cursor, then use /repomemory-analyze in Cursor chat. Cursor's AI does the analysis using the MCP tools — whatever model Cursor is using (it can even switch models mid-task).

Supported Providers

ProviderModelsEnv Variable
anthropicclaude-sonnet-4-6, claude-opus-4-6ANTHROPIC_API_KEY
openaigpt-4o, o3-miniOPENAI_API_KEY
geminigemini-2.0-flash, gemini-2.5-proGEMINI_API_KEY / GOOGLE_API_KEY
grokgrok-3, grok-3-miniGROK_API_KEY / XAI_API_KEY

Embeddings (optional, for semantic search): Gemini text-embedding-004 (free, default) or OpenAI text-embedding-3-small. Auto-detected from available API keys.

All Commands

bash
repomemory go                            # One-command setup (add --yes for non-interactive)repomemory wizard                        # Interactive guided setuprepomemory analyze                       # AI-powered repo analysisrepomemory analyze --merge               # Update without overwriting editsrepomemory analyze --dry-run             # Preview without API callrepomemory search <query>                # Search knowledge base from terminalrepomemory status                        # Coverage and freshness reportrepomemory doctor                        # Diagnostics and health checkrepomemory dashboard                     # Local web UI (localhost:3333)repomemory risk                          # Hotspots, coupling, ownership analysisrepomemory risk -f src/auth.ts           # Targeted risk assessment for specific filesrepomemory sync                          # Sync git history to changelogrepomemory setup <tool>                  # Configure Claude/Cursor/Copilot/etcrepomemory hook install                  # Auto-sync changelog on commitsrepomemory global list                   # Manage global developer contextrepomemory global export                 # Export global context as JSON

Configuration

.repomemory.json in your repo root (all fields optional):

json
{  "provider": "anthropic",  "model": "claude-sonnet-4-6",  "embeddingProvider": "gemini",  "hybridAlpha": 0.5,  "maxFilesForAnalysis": 80,  "enableGlobalContext": true}

Custom ignorePatterns and keyFilePatterns are additive — they extend built-in defaults, not replace them.

Why Not Just CLAUDE.md?

CLAUDE.mdrepomemory
MaintenanceManualAI-generated + agent-maintained
SearchLoad everythingHybrid keyword + semantic
Cross-toolClaude Code only7 tools supported
Team knowledgeOne person writesEvery AI session contributes
DecisionsMixed in with instructionsStructured, searchable
RegressionsNot trackedPrevents repeat bugs
SessionsNot trackedAuto-captured on shutdown
FreshnessUnknownStaleness detection + auto-purge

repomemory doesn't replace CLAUDE.md — it complements it. CLAUDE.md is for instructions and rules. .context/ holds the knowledge that grows over time.

Contributing

See CONTRIBUTING.md for development setup, testing, and contribution guidelines.

License

MIT


Built for developers who are tired of AI agents forgetting everything between sessions.

Report Bug · Request Feature · npm

来源:README.md,提交 b5b9d25

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.3.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Repomemory 集成