Local RAG Backend
About
A local RAG backend powered by Docker Compose, supporting various document formats for search.
Details
- Author
- suwa-sh
- Categories
- Search, Knowledge Base, Other
Jump to
Setup
Install Local RAG Backend in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/suwa-sh/local-RAG-backend
Follow the installation instructions in the repository README, then restart your MCP client.
ローカル環境のdocker composeで完結するRAGシステムのバックエンドです。各種ドキュメントを登録し、MCP serverで検索できます。
- 幅広いファイル形式に対応:unstructuredを利用して、PDF、Office、テキスト、画像など多様なファイル形式に対応しています。
- MCP検索機能:graphiti MCP Serverの実装を流用して、Model Context Protocol対応の検索を提供します。
- 高度なRAG機能:graphitiを利用して、ベクトル検索 + グラフ検索 + 全文検索の結果を、関係性でリランキングした結果を返します。
- 時系列の関係性の変化を追跡:graphitiのエピソード機能で、登録したドキュメント内の概念の関係性の変化を追跡できます。
graph TB User[システム管理者] AIAgent[MCP Client] subgraph "local-RAG-backend" Ingest[ドキュメント登録<br/>unstructured] MCPServer[ナレッジ検索<br/>MCP Server] Graphiti[graphiti core] Neo4j[Neo4j] end LLM[LLMモデル<br/>OpenAI API互換] Ollama[Embeddingモデル<br/>OpenAI API互換] User -->|コマンド実行| Ingest AIAgent -->|MCP Tools呼び出し| MCPServer Ingest --> Graphiti MCPServer --> Graphiti Graphiti -->|ドキュメント登録| Neo4j Graphiti -->|検索クエリ実行| Neo4j Graphiti ---> LLM Graphiti ---> Ollama
- OpenAPI互換のLLM APIが利用できる
- 利用するモデル
- ベクトル検索に利用するEmbeddingモデル
- グラフ検索に利用するLLMモデル
- リランキングに利用する軽量なLLMモデル
- 例:
- Embeddingモデル:ローカルのOllama
- LMモデル:OpenAI
- グラフ検索:o4-mini
- リランキング:gpt-4.1-nano
- LLMモデルをローカルのOllamaで利用する場合、フォーマット指定のレスポインスを、数秒で返すパフォーマンスが必要です。
- OpenRouterは rate limit エラーになりやすいので、ルーティング先を直接指定することをおすすめします。
# 実行ディレクトリの作成 mkdir -p path/to/RAG/data/input/ cd path/to/RAG/ # ファイルのダウンロード curl -Lo docker-compose.yml https://raw.githubusercontent.com/suwa-sh/local-RAG-backend/refs/heads/main/docker-compose.yml curl -Lo .env https://raw.githubusercontent.com/suwa-sh/local-RAG-backend/refs/heads/main/.env.example # 環境変数設定 vi .env # 起動 docker compose up -d
# ドキュメントを配置 cp -r /path/to/documents/ path/to/RAG/data/imput/ # 一括登録実行 # ※エラー終了した場合も、同じコマンドで前回失敗したファイルから再開できます。 docker compose run --rm ingest # ログ確認 tail ./data/logs/ingest-.log
data/input/ : 未処理ファイル data/input_work/ : エピソード登録中(エピソードファイル保存済み) data/input_done/ : 処理完了ファイル data/input_chunks/ : エラー時再処理用チャンク分割ファイル
-
n8n / AI Agent node や Claude DeskctopなどのMCP Clientから接続
{ "mcpServers": { "graphiti-memory": { "transport": "sse", "url": "http://localhost:8000/sse" } } }
// RAG用検索 const result = await mcp.call_tool("search_for_rag", { query: "RAGシステムについて", group_ids: ["default"], }); // 事実検索 const result = await mcp.call_tool("search_memory_facts", { query: "RAGシステムについて", group_ids: ["default"], max_facts: 10, }); // ノード検索 const nodes = await mcp.call_tool("search_memory_nodes", { query: "システム", group_ids: ["default"], max_nodes: 5, // entity_types: ["Preference"], // 任意: エンティティ種別で絞り込み }); // エピソード取得 const episodes = await mcp.call_tool("get_episodes", { group_ids: ["default"], max_episodes: 10, }); // エピソード追加 const addResult = await mcp.call_tool("add_memory", { name: "新しい情報", episode_body: "ここに内容を記述", group_id: "default", source: "text", });
環境変数の一覧と説明・既定値は.env.exampleを参照してください(設定はこのファイルで一元管理しています)。
# .env.example をコピーして編集 cp .env.example .env vi .env
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Fetch, convert, and search AWS documentation pages, with recommendations for related content.
Search campgrounds around the world on campertunity, check availability, and provide booking links.
The Ferryhopper MCP Server exposes ferry routes, schedules and booking redirects so an AI assistant can discover connections across Europe and the Mediterranean and send users to Ferryhopper to complete bookings.
All-in-One SEO & Web Intelligence Toolkit API from FetchSERP.
MCP server that provides read-only access to HyperKitty, the web-based email archive component of Mailman 3.
At Sunrise Apps, we believe AI agents should be limitless, especially when it comes to visual data. We created ImageSorcery to bridge the critical gap in AI's ability to interact with and manipulate images directly, all while upholding the highest standards of privacy and security.
Just Domain is the domain registrar for businesses built with AI. Its remote MCP server checks availability and returns first-year and renewal pricing, plus a link to register on justdomain.ai, with DNS and WHOIS privacy in the same place. No account, no API key, read only. Endpoint: https://mcp.justdomain.ai/
Research tools, including a Sqlite-backed document stash
Semantic search over 9 free-license stock photo sources. Hosted remote server with OAuth — no API key to paste.
SerpApi MCP Server for Google and other search engine results
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




