RagRabbit
自托管网站AI搜索、LLMs.txt、抓取您内容的MCP服务器。1-单击Vercel上的部署。

运作原理
特性
- 💬 聊天小部件:嵌入式AI聊天代理和即时搜索
- 🕸️ 网站爬虫:使用pgVector和PostgreSQL抓取和索引页面
- 📄 LLMs.txt生成:通过ToC重新排序完全可定制
- 🔌 MCP服务器:
npx @ragrabbit/mcp从Claude Desktop和Cursor IDE访问您的文档 - 🛠️ 灵活:身份验证、开源、API密钥访问
- 🚀 易于部署:在Vercel上一键设置
集成:
演示
安装
要在Vercel上安装:

要求:
- Node.js 20.x
- PostgreSQL w/pgVector
- OpenAI API密钥
- (可选)Trigger.dev API密钥
配置
设置以下环境变量:
- OPENAI_API密钥
用户名/密码登录:
- 管理员用户
- 管理员密码
电子邮件登录:
- RESEND_AUTH=真
- 要限制对这些电子邮件的访问:RESEND_ALLOWED_emails=“test@test.com,foo@bar.com"
- 不发送电子邮件,而是记录登录链接(在Vercel日志中):SIMULATE_EMAIILS=true
看 .env.示例 查看完整列表。
如何使用
使用“索引”部分添加新的网址/网站进行索引,可以是单个网址或递归抓取的网站:
RagRabbit Indexing RagRabbit Crawl Modal
然后启动作业运行器(保持选项卡打开,直到完成)
在LLM.txt部分,您可以预览生成的LLM.txt文件:
然后,您可以使用以下代码片段将小部件嵌入到您的网站中:
聊天按钮
在页面底部嵌入一个按钮:
/widget.js">聊天小部件
在页面的某个位置插入搜索输入:
与React.js一起使用
"use client";
import Script from "next/script";
export function RagRabbitSearch() {
return (
<>
{`
ragrabbit-search .ragrabbit-search-input {
padding: 6px 12px;
}
`}
{/* @ts-ignore - Custom element will be mounted by external script */}
);
}MPC服务器
MCP服务器允许任何受支持的AI客户端使用语义搜索从您的文档中检索页面。
克劳德桌面
添加一个带有产品名称的自定义mcp服务器,以便Claude AI在查找有关它的信息时可以使用它。
在……里面 claude_desktop_config.json (克劳德->设置->开发人员->编辑配置)
{
"mcpServers": {
"": {
"command": "npx",
"args": ["@ragrabbit/mcp", "http:///", ""]
}
}
}在游标IDE中
转到光标->设置->光标设置->MCP
并添加一个新的MCP类型 command 使用命令:
npx @ragrabbit/mcp", "http:///", ""论据:
ragrabbit-url:(必填)RagRabbit实例的基本URL,例如https://my-ragrabbit.vercel.com/name:(必填)文档搜索服务的自定义名称(默认为“RagRabbit”),以便AI在查找信息时知道如何使用它
配置选项
聊天按钮
您可以通过在widget.js脚本标签中添加以下参数来配置聊天按钮:
按钮文本
搜索小部件
您可以通过添加以下参数并使用mountSearch调用来配置搜索小部件:
search占位符
window.mountSearch("search-container", { searchPlaceholder: "Search documentation..." });
集成
富马酸类
创建一个组件来替换“搜索”对话框:
pnpm add @ragrabbit/search-react"use client";
import type { SharedProps } from "fumadocs-ui/components/dialog/search";
import { RagRabbitModal } from "@ragrabbit/search-react";
export default function SearchDialog({ open, onOpenChange }: SharedProps) {
return ;
}然后将其设置在 layout.tsx:
...
可选择添加浮动聊天按钮:
"use client";
import { RagRabbitChatButton } from "@ragrabbit/search-react";
export default function ChatButton() {
return ;
}并将其添加到 layout.tsx:
...发展
# Start the db (Docker needed)
pnpm dev:utils # Starts postgresql with pgvector, Storybook and Drizzle ORM Studio
# Start the app
cd apps/saas
pnpm dev目录结构:
RagRabbit是一个包含Turborepo、Next.js应用程序和具有单独包的模块化设计的monorepo。
apps/
├── docs -> the documentation site
├── saas -> the main application
└── web -> the web site
packages/
├── db -> the database with Drizzle ORM
├── auth -> the authentication with Auth.js
├── core -> shared utils
├── design -> the design system
├── rag -> the LLM and RAG package with LlamaIndexTS
├── jobs -> job runner with Trigger.dev
└── storybook -> a Next.js Storybook app
.cursorrules -> Fine tuned Cursor rules with all the locations to work with the monorepo作者
许可证
麻省理工学院
