RagForge
具有持久局部脑的通用RAG药物
使用人工智能工具将任何代码库、文档或网络内容转换为可搜索的知识图。
许可证–Luciform研究源许可证(LRSL)v1.1
©2025 Luciform Research。除下文授予的权利外,保留所有权利。
- 免费用于: 研究、教育、个人项目、自由职业者/小规模(月收入≤10万欧元)
- 超过阈值的商业用途 需要单独协议
- 联系人: legal@luciformresearch.com
- 全文: 许可证
______________________________________________________________________
RagForge是什么?
RagForge是一个 AI代理框架 带着一个 局部持续性脑 (~/.ragforge):
- 守护进程架构 -按需唤醒,干净关闭
- 文件监视 -增量接收文件更改
- 差异感知更新 -只重新解析更改的内容
- 多项目支持 -同时处理多个代码库
- 针对规模进行了优化 -高效处理大型项目
┌─────────────────────────────────────────────────────────────┐
│ AGENT BRAIN (~/.ragforge) │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Neo4j + Embeddings │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │Project A │ │Quick │ │Web Pages │ │ │
│ │ │(code) │ │Ingest │ │(docs) │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │ │
│ │ ↓ │ │
│ │ Unified Semantic Search │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ FILE WATCHER → Incremental Ingestion → Graph Update │
└─────────────────────────────────────────────────────────────┘______________________________________________________________________
摄入能力
代码
| 语言 | 解析器 |
|---|---|
| TypeScript、TSX | 带作用域提取的完整AST |
| JavaScript、JSX | 全AST解析 |
| Python | 带类/函数提取的AST |
| Vue,Svelte | SFC解析与脚本提取 |
| HTML、CSS、SCSS | 结构提取 |
| 其他语言 | 基于正则表达式的回退解析器 |
文件
| 格式 | 方法 |
|---|---|
| pdfjs-dist(Mozilla PDF.js)+用于扫描的Gemini Vision | |
| DOCX | 本地解析(猛犸象) |
| XLSX | 纸张/单元格提取(XLSX) |
| Markdown | 节/标题解析 |
| JSON、YAML | 结构提取 |
| CSV | 行/列解析 |
3D和媒体
| 格式 | 功能 |
|---|---|
| glTF、GLB | 元数据+多视图渲染 |
| OBJ | 几何提取 |
| 图像(PNG、JPG…) | OCR+视觉+嵌入 |
网络
| 特性 | 描述 |
|---|---|
| 网络爬行 | 带有链接跟踪的递归深度 |
| JS渲染 | 动态页面的剧作家 |
| 搁浅 | 实时信息的网络搜索 |
| LRU缓存 | 最后6页用于快速重新访问 |
______________________________________________________________________
搜索与理解
| 特性 | 描述 |
|---|---|
| 语义搜索 | 通过Gemini实现超快速矢量嵌入 |
| 模糊搜索 | Levenshtein匹配,无需摄入 |
| Smart Grep | 在所有文件中搜索正则表达式 |
| 签名过滤 | 按函数签名、docstring、类型筛选 |
| 自定义密码 | 直接图形查询 |
| 一致性锁 | 在摄取过程中搜索被阻止以获得一致性 |
______________________________________________________________________
代理能力
与本地模型和云API兼容:
| 特性 | 描述 |
|---|---|
| 结构化查询 | 对回复应用提示 |
| 批处理 | 高效的批量操作 |
| 文件编辑 | 具有自动摄取功能的读/写/编辑 |
| Shell执行 | 白名单命令 |
| 递归子代理 | 为复杂任务生成代理 |
| MCP暴露 | 高级型号的完整工具访问权限 |
研究代理
这 研究代理 是一个针对代码库探索和文档优化的自主代理。
通过MCP使用 (来自克劳德或其他客户):
call_research_agent({ question: "How does authentication work?" })它的作用:
- 使用以下内容搜索知识图
brain_search - 自动读取相关文件
- 探索与的代码关系
explore_node - 构建一份包含引文的全面降价报告
- 返回置信水平(高/中/低)
输出示例:
{
"report": "# Authentication System\n\n## Overview\n...",
"confidence": "high",
"sourcesUsed": ["src/auth.ts", "src/middleware/jwt.ts"],
"toolsUsed": ["brain_search", "read_file", "explore_node"],
"iterations": 3
}______________________________________________________________________
媒体生成
| 工具 | 说明 |
|---|---|
generate_image | 通过Gemini将文本转换为图像 |
edit_image | AI驱动的图像编辑 |
generate_multiview_images | 4个连贯的3D视图 |
generate_3d_from_text | 全文本到3D管道 |
generate_3d_from_image | 通过Trellis将图像转换为3D |
render_3d_asset | 多视图3D渲染 |
analyze_3d_model | 3D资产的视觉分析 |
______________________________________________________________________
快速开始
先决条件
- 码头工人 -Neo4j数据库需要
- (Windows/macOS) - 或 sudo apt install docker.io (Linux)
1.安装
npm install -g @luciformresearch/ragforge-cli2.设置(Docker+Neo4j)
ragforge setup这将:
- ✅ 检查Docker是否已安装并正在运行
- ✅ 创建Neo4j容器(
ragforge-neo4j) - ✅ 配置
~/.ragforge/.env自动地
选项:
ragforge setup --password myPassword # Custom Neo4j password
ragforge setup --force # Recreate container3.添加您的API密钥
# Add to ~/.ragforge/.env
GEMINI_API_KEY=your-gemini-key # Required for embeddings & search
REPLICATE_API_TOKEN=your-token # Optional, for 3D generation4.与克劳德(MCP)一起使用
将RagForge添加到您的Claude配置中(请参阅 MCP服务器 部分),然后问克劳德:
"Use brain_search to find authentication code"
"Ingest the ./src directory"
"Call the research agent to explain the database layer"______________________________________________________________________
MCP服务器
RagForge通过以下方式公开所有工具 模型上下文协议 适用于Claude、GPT和其他MCP兼容客户端。
Claude代码(CLI)的设置
- 构建RagForge (如果来自来源):
cd ragforge && npm install && npm run build- 添加到Claude代码配置 (
~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"ragforge": {
"command": "node",
"args": ["/path/to/ragforge/packages/cli/dist/mcp.js"],
"env": {
"GEMINI_API_KEY": "your-key"
}
}
}
}- 重新启动Claude代码 验证工具可用:
/mcpClaude桌面设置
添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)或同等版本:
{
"mcpServers": {
"ragforge": {
"command": "ragforge",
"args": ["mcp"]
}
}
}使用克劳德的RagForge
连接后,您可以要求Claude使用RagForge工具:
"Use brain_search to find authentication code in my project"
"Ingest the ./src directory and search for API endpoints"
"Call the research agent to explain how the database layer works"MCP提供的关键工具:
| 类别 | 工具 |
|---|---|
| 搜索 | brain_search, grep_files, search_files |
| 文件 | read_file, write_file, edit_file, delete_path |
| 摄入 | ingest_directory, ingest_web_page, forget_path |
| 代理 | call_research_agent (自主研究) |
| Git | run_command, git_status, git_diff |
| 媒体 | generate_image, generate_3d_from_text, render_3d_asset |
| 网络 | fetch_web_page, search_web |
| 管理员 | exclude_project, include_project, list_brain_projects |
______________________________________________________________________
项目结构
ragforge/
├── packages/
│ ├── core/ # Main package
│ │ ├── src/
│ │ │ ├── brain/ # BrainManager, knowledge persistence
│ │ │ ├── runtime/
│ │ │ │ ├── adapters/ # File parsers (code, docs, media, web)
│ │ │ │ ├── agents/ # RAG agent implementation
│ │ │ │ ├── projects/ # ProjectRegistry, multi-project
│ │ │ │ └── ingestion/ # Incremental ingestion, file watcher
│ │ │ └── tools/ # Agent tools (file, image, 3D, web, brain)
│ │ └── defaults/ # Default YAML configs
│ │
│ └── cli/ # CLI commands (agent, mcp, ingest)
│
├── docs/project/ # Design docs and session notes
└── examples/ # Example projects______________________________________________________________________
路线图
- \[x\] 使用Neo4j的持久大脑
- \[x\] 通用文件摄取
- \[x\] 嵌入语义搜索
- \[x\] 网络爬行和接地
- \[x\] 图像和3D生成
- \[x\] MCP服务器集成
- \[x\] 项目被排除在搜索之外
- \[\]本地模型支持(Ollama)
- \[\]API爬虫(Swagger/OpenAPI)
- \[\]数据库爬虫(模式提取)
- \[\]带墨迹的终端UI(React)
- \[\]协作多代理工作流
______________________________________________________________________
发展
# Clone and install
git clone https://github.com/LuciformResearch/ragforge
cd ragforge
npm install
# Build all packages
npm run build
# Run tests
npm test______________________________________________________________________
链接
______________________________________________________________________
#RAGForge#LuciformResearch#RAG#LLM#代理#DevTools#AIEngineering#Neo4j#MCP
