Skip to content

soyoshio/RAGent

Repository files navigation

English 中文

RAGent

CI License Python Version

RAGent is a RAG-powered intelligent agent designed for code knowledge base Q&A. It combines Plan-and-Execute with ReAct paradigms and supports dynamic tool ecosystem expansion via the MCP protocol.

Features

  • Multi-way Retrieval — Vector (semantic) + Keyword (BM25) + Graph (relational) with reciprocal rank fusion
  • Hybrid Agent — Planner generates task plans; Executor runs ReAct loops
  • MCP Protocol — Dynamically discover and invoke external Tool Servers
  • Progressive Skill Disclosure — Automatically adjust capability level based on task complexity
  • CLI Interface — Supports both direct queries and interactive chat modes

Quick Start

# Install dependencies
pip install ragents

# Configure environment
cp .env.example .env
# Edit .env with your API keys

# Direct query
ragent query "How do React Hooks work?"

# Interactive chat
ragent chat

# Build index
ragent index ./my_docs/ --output ./index/my_docs

Architecture Overview

graph LR
    CLI[CLI] --> Agent[HybridAgent]
    Agent --> Planner[Planner]
    Agent --> Executor[ReAct Executor]
    Executor --> RAG[RAG Retriever]
    Executor --> Tools[ToolRegistry]
    Tools --> MCP[MCP Client]
    Tools --> Local[Local Tools]
    Planner --> LLM[LLM Provider]
    Executor --> LLM
Loading

Documentation

Project Structure

RAGent/
├── src/ragents/       # Main package
│   ├── cli/           # Command-line interface
│   ├── agent/         # Agent core (Planner + Executor)
│   ├── rag/           # Retrieval layer
│   ├── mcp/           # MCP protocol client
│   ├── tools/         # Local tool implementations
│   ├── llm/           # LLM abstraction
│   ├── schema/        # Pydantic data models
│   └── utils/         # Utilities
├── tests/             # Unit, integration, and benchmark tests
├── docs/              # Documentation (en / zh)
├── scripts/           # Development and deployment scripts
└── examples/          # Sample input documents

Development

See Development Guide for setup instructions and contribution guidelines.

License

MIT

About

RAG + Agent hybrid architecture for intelligent developer documentation Q&A with MCP, Skill Router, and multi-modal retrieval.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors