Token导航 LogoToken导航

MCP Server · AI代理

Agent Rag (Kelasdev)

agentRAG是一个专为AI代理设计的智能记忆系统,通过结构化检索帮助代理在代码库和文档中进行高效推理。

stdio官方级别未说明来源级核验工具 3
AI代理PythonClaude文档检索

快速开始

作者 / 组织
kelasdev
提供方
kelasdev

工具数量

3

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

2

仓库热度

收录来源

1 个

MCP World

选型结论

Agent Rag (Kelasdev) 属于AI代理类 MCP Server,公开资料标注 3 个工具,通过stdio 本地进程接入,适配 Claude,有可以直接复制的安装命令;接入前先确认权限范围。

分类

AI代理

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

pip install -r requirements.txt

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 对应的运行时,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 3 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

agentRAG

Intelligent Memory System for AI Agents - Hybrid text+code RAG that helps agents reason over codebases with structured retrieval instead of naive grep-and-guess.

🎯 Overview

agentRAG adalah sistem memory cerdas yang dirancang khusus untuk AI agents. Sistem ini membantu agent bekerja di atas codebase dan dokumentasi dengan retrieval yang lebih terstruktur, sehingga agent tidak hanya membuka file secara acak atau menebak arsitektur dari potongan teks yang kebetulan cocok.

✨ Key Features

  • 🧠 Automatic Query Planning - Sistem otomatis mengklasifikasikan query Anda:

- Deteksi intent (explain function, bug hunt, refactor, dll) - Klasifikasi tipe konten (code vs documentation) - Ekstraksi bahasa pemrograman - Identifikasi nama function/class yang dicari

  • 🔄 Smart Fallback Strategy - Jika pencarian strict tidak menemukan hasil, sistem secara bertahap melonggarkan filter untuk memberikan hasil terbaik yang tersedia
  • 📦 Hybrid Chunking - Strategi chunking yang berbeda untuk setiap tipe konten:

- Code: AST-based chunking (per function/class) menggunakan Tree-sitter - Text: Delimiter-based chunking (per section/topic) untuk menjaga konteks

  • 🔌 MCP Server Integration - Native support untuk Model Context Protocol:

- 3 tools siap pakai: query_memory, ingest_documents, health_check - Compatible dengan Claude, Kiro CLI, dan MCP clients lainnya - Natural language query support

  • ⚡ Delta Sync - Re-ingest yang efisien:

- Hanya update chunks yang berubah - Hapus chunks yang sudah tidak ada - Stable chunk identity dengan content hashing

  • 👀 Watch Mode - Pantau folder dan ingest perubahan secara batch:

- Command: agentrag watch - Menghormati .gitignore - Debounce, batching, dan extension filter

  • 🌐 URL Ingest - Ingest langsung dari web:

- Support PDF, DOCX, Markdown, HTML - Auto-sanitization untuk menghilangkan noise (header/footer/menu) - Via Jina Reader API

  • 🎨 Multi-Language Support - Python, JavaScript, TypeScript, Go, Java, Rust, C/C++

🏗️ Architecture

User Query → Query Planner → Retrieval → Ranking → Results
                ↓
         Auto-detect:
         - Intent
         - Node Type
         - Language
         - Symbol Name

🚀 Use Cases

  • AI Agent Memory - Berikan AI agent akses ke codebase dan dokumentasi Anda
  • Code Search - Cari function, class, atau pattern tertentu dalam codebase
  • Documentation Search - Temukan guide, tutorial, atau API docs dengan cepat
  • Bug Investigation - Cari error patterns atau exception handling
  • Refactoring Assistant - Temukan code yang perlu di-refactor

📦 Installation

Prerequisites

  • Python 3.10+
  • Qdrant Cloud account (atau local Qdrant instance)
  • Understanding of vector dimensions (recommended)

Install

  1. Copy .env.example to .env and fill QDRANT_URL + QDRANT_API_KEY.
  2. Install dependencies with uv sync (recommended) or:
pip install -r requirements.txt
pip install -e .

If you want to use EMBEDDING_PROVIDER=llama_cpp_python on Windows/Python 3.12, do not rely on a plain pip install llama-cpp-python. Use the verified wheel install:

pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu --only-binary=:all:
python -c "from llama_cpp import Llama; print('Success: llama-cpp-python is working!')"

For a repeatable Windows setup, you can also run:

powershell -ExecutionPolicy Bypass -File .\scripts\install_windows.ps1

For development/testing:

pip install -r requirements-dev.txt

Quick Start

  1. Run ingest (local file/dir):
agentrag ingest docs/PRD.md

Ingest from web URL (via Jina Reader public API):

agentrag ingest "https://example.com/guide.pdf"

Ingest multiple URLs:

agentrag ingest \
  "https://example.com/a.pdf" \
  "https://example.com/b.md" \
  "https://example.com/c.docx"

Mixed local + URL targets:

agentrag ingest ./docs "https://example.com/spec"

Watch a folder and auto-ingest changes:

agentrag watch ./docs
agentrag watch ./my-project --extensions .py,.md --batch-size 3 --debounce-seconds 2
agentrag watch ./my-project --dry-run
  1. Run query:
agentrag query "qdrant cloud url" --node-type text --top-k 3
  1. Query result is returned as JSON (MCP-friendly), including detected plan and hits.
  1. Check Qdrant connectivity:
agentrag health

🔌 MCP Server Integration

agentRAG menyediakan MCP (Model Context Protocol) server untuk integrasi dengan AI agents.

Available Tools

  1. query_memory - Search dengan automatic query planning
  2. ingest_documents - Tambah dokumen ke memory
  3. health_check - Cek status sistem

Configuration

Add to your MCP client config (e.g., Kiro CLI ~/.kiro/mcp.json):

{
  "mcpServers": {
    "agentrag": {
      "command": "python",
      "args": ["-m", "agentrag.mcp_server"],
      "cwd": "/path/to/agentRAG",
      "env": {
        "PYTHONPATH": "/path/to/agentRAG"
      }
    }
  }
}

Usage Example

AI Agent: "Use agentrag to find python function for calculate ROI"

agentRAG automatically:
- Detects: intent=explain_function, node_type=code, language=python
- Searches with filters
- Returns ranked results

Documentation:


📚 Features Deep Dive

Automatic Query Planning

Query Anda otomatis dianalisis untuk mendeteksi:

Intent Detection:

  • explain_function - "python function calculate_roi"
  • bug_hunt - "bug in authentication error"
  • refactor_guidance - "refactor user service"
  • find_snippet - "show code example"
  • general_query - Query umum

Node Type Classification:

  • code - Jika menyebut "function", "class", "method"
  • text - Jika menyebut "docs", "documentation", "guide"

Language Detection:

  • Auto-detect dari keyword: "python", "javascript", "golang", dll

Symbol Extraction:

  • "function calculate_roi" → symbol_name: calculate_roi
  • "class UserService" → symbol_name: UserService

Smart Fallback Strategy

Jika strict search tidak menemukan hasil:

Strict Search (all filters)
    ↓ No results?
Fallback 1: Remove symbol_name
    ↓ No results?
Fallback 2: Remove language
    ↓ No results?
Fallback 3: Remove node_type
    ↓
Return best available results

Hybrid Chunking Strategy

Source TypeStrategyDescription
CodeAST-BasedPer function/class menggunakan Tree-sitter atau Python AST
TextDelimiter-BasedPer section/topic berdasarkan Markdown headers

Supported Languages:

  • Python (built-in AST)
  • JavaScript/TypeScript (Tree-sitter)
  • Go, Java, Rust, C/C++ (Tree-sitter)

Learn More:


🔧 Advanced Usage

Ingest Behavior

  • Re-ingest uses delta sync per source_id.
  • Chunk identity is stable: hash(source_id + content_hash).
  • Only changed/new chunks are upserted.
  • Stale chunks (no longer present in source) are deleted.
  • ingest accepts local files/directories and http(s) URLs in the same command.
  • URL ingest fetches content through https://r.jina.ai/ and sanitizes common web noise (header/footer/menu separators/emojis) before chunking.
  • For URL sources, source_id is the URL itself. Re-running ingest on the same URL performs delta sync against that URL.
  • Dry-run is available to inspect changes without writing:

- watch monitors file changes and triggers batched ingest calls. - watch uses Git-aware ignore handling when the target folder is inside a Git repo. - watch supports --dry-run, --extensions, --batch-size, --debounce-seconds, and --non-recursive.

agentrag ingest ../PYRAG/test_data --dry-run

Dry-run with multiple URLs:

agentrag ingest \
  "https://example.com/a.pdf" \
  "https://example.com/b" \
  --dry-run

.gitignore Support

When ingesting directories, agentRAG automatically respects .gitignore patterns:

  • Reads .gitignore from the target directory
  • Excludes files matching patterns (wildcards, directories)
  • Always excludes .git/ directory by default
  • Works with nested directories and complex patterns

Example:

# .gitignore in your project
*.pyc
__pycache__/
node_modules/
dist/

# Ingest will automatically skip these files
agentrag ingest ./my-project

Code Graph (Definitions / Callers / Callees)

agentRAG sekarang mendukung navigasi graph sederhana berbasis payload index di Qdrant (tanpa penyimpanan lain):

  • Definitions: temukan chunk definisi simbol (function/class/method) via code_metadata.symbol_name.
  • Callers: temukan chunk yang memanggil sebuah simbol via code_metadata.calls.
  • Callees: ambil daftar pemanggilan dari payload definisi (field code_metadata.calls).

CLI commands:

# Watch local changes and auto-ingest
agentrag watch ./my-project --extensions .py,.md

# Definisi simbol
agentrag defs calculate_roi --language python --limit 10

# Siapa yang memanggil simbol ini?
agentrag callers calculate_roi --language python --limit 25

# Simbol ini memanggil apa saja?
agentrag callees calculate_roi --language python

MCP tool (opsional): code_graph dengan action salah satu dari: definitions, callers, callees.

URL Ingest Details

  • Fetch path: JINA_READER_BASE_URL + target_url (default https://r.jina.ai/).
  • Intended web document targets: md, txt, rst, pdf, docx, doc, html, htm, and generic web pages.
  • Sanitization removes common navigation/header/footer fragments, separator lines, and emoji-heavy noise before chunking.
  • If fetch fails or sanitized content is empty, target is counted as skipped.

URL Ingest Config

Set in .env:

JINA_READER_BASE_URL=https://r.jina.ai/
WEB_FETCH_TIMEOUT_SECONDS=45
  • JINA_READER_BASE_URL: Base endpoint for web-to-text extraction.
  • WEB_FETCH_TIMEOUT_SECONDS: Request timeout per URL fetch.

📋 Chunking Strategy

Source TypeStrategyDescription
Kode PemrogramanAST-Based ChunkingMenggunakan parser (seperti Tree-sitter) untuk memotong kode berdasarkan struktur logika (Abstract Syntax Tree), seperti per class atau per fungsi. Tujuannya agar sintaks tetap utuh dan tidak terpotong di tengah blok logika.
Teks / NarasiSafeword / DelimiterMemotong teks berdasarkan penanda batas (misalnya ===BATAS=== atau header Markdown #, ##). Tujuannya menjaga satu gagasan/topik tetap berada dalam satu chunk utuh tanpa merusak makna paragraf.
  • Python uses built-in ast extraction.
  • JavaScript/TypeScript/Go/Java use tree-sitter for structural chunk extraction.
  • If tree-sitter runtime is unavailable at execution time, the chunker falls back to a regex-based structural parser for those languages.

🧪 Testing

Install dev dependencies:

pip install -r requirements-dev.txt

Quick Test

Run all tests:

./scripts/run_all_tests.sh

Or run individual test suites:

# Unit tests (pytest)
pytest -q

# Integration tests
python scripts/test_mcp_integration.py

# Scenario tests
python scripts/test_scenarios.py

Test Coverage

Current Status: ✅ 54/56 tests passing (96.4% success rate)

  • Unit Tests: 36 passed, 2 skipped
  • Integration Tests: 3 passed
  • Scenario Tests: 15 passed

See TEST_REPORT.md for detailed test results and coverage analysis.

MCP Server Testing

Test the MCP server integration:

# Unit tests
pytest tests/test_mcp_server.py -v

# Integration test
python scripts/test_mcp_integration.py

# Visual testing with MCP Inspector
npx @modelcontextprotocol/inspector python -m agentrag.mcp_server

See MCP_TESTING.md for comprehensive testing guide and MCP_QUICK_REF.md for quick reference.


📚 Documentation


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License.

🙏 Acknowledgments

工具与能力

工具数量

3

资源数量

0

提示词数量

0

能力标签

AI代理Python本地部署代码检索文档检索智能记忆多语言支持

支持客户端

Claude

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

多步任务编排

把拆解、检索、执行串成一条链,模型按步骤调用工具。

长期上下文

把会话、笔记和知识放到外部存储,换个会话还能接着做。

接自有流程

把内部系统和模型连起来,让助手调用已有的工作流。

选择建议

值得选的地方

  • 只提供 3 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 运行环境,换机器要重新装一遍。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Agent Rag (Kelasdev)

MCP World · 本页

3stdio有1 个2026-05-17
Everything Claude Code

MCP World

0stdio有1 个2026-05-17
Filesystem 560c4363

MCP World

13未说明未标注2 个2026-05-17
Time 7365cb6d

MCP.so

2SSE有2 个2026-05-17
Server Everything (everything)

MCP World

11stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Agent Rag (Kelasdev) 怎么安装?

公开资料给出的安装命令是 pip install -r requirements.txt,运行环境为 未标注。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Agent Rag (Kelasdev) 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 未标注;保存后完全退出客户端再打开,配置才会生效。

Agent Rag (Kelasdev) 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Agent Rag (Kelasdev) 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Agent Rag (Kelasdev) 支持哪些客户端?

公开资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP