nageoffer/ragent

企业级 Agentic RAG 智能体 - 全链路覆盖文档解析、多路检索、意图识别、问题重写、会话记忆、MCP 工具调用与深度思考。面向真实业务场景,从 0 到 1 完整工程实现。

Ragent AI – A Production‑Ready Java Platform for Agentic RAG

What it is

  • A Java‑centric, end‑to‑end framework that lets you build retrieval‑augmented generation (RAG) and agentic AI applications. It covers everything from ingesting documents to answering questions, calling external tools, and managing conversation memory.

Key capabilities

Area What Ragent provides
Hybrid retrieval Parallel recall from vector stores, keyword indexes, knowledge‑graph, and live web search. Supports deduplication, RRF fusion and reranking.
Query understanding Query‑term mapping, question rewriting & splitting, tree‑structured intent detection, and routing across multiple knowledge bases.
Model handling Model tiering, first‑packet latency detection, circuit‑breaker fallback, and multi‑model routing.
Session memory Recent‑N‑turn cache + persisted summary to keep context while controlling token usage.
Traffic protection Redis‑based fair queue and distributed concurrency limits to prevent spikes from overwhelming model services.
Knowledge‑loop Pluggable ingestion pipelines, remote refresh, answer provenance, user feedback, tracing and an admin UI.

Architecture

  • Seven Maven modules separate concerns: infrastructure AI clients, system services, RAG core, Agent engine, bootstrap, shared framework utilities, and an example MCP (Model‑Centered‑Programming) tool server.
  • The design isolates AI‑vendor specifics, storage back‑ends, and retrieval strategies so you can swap components without rewriting the main workflow.

Agentic workflow (v2)

  • Uses a ReAct‑style loop where the LLM can decide to retrieve knowledge, invoke MCP tools, or run custom Skills.
  • Memory is managed at three levels (short‑term, persisted summary, long‑term) and can include human‑in‑the‑loop confirmations for write actions.

Production‑grade features

  • Redis fair‑queue, Lua‑based atomic rate‑limiting.
  • Multi‑candidate model routing with latency checks and three‑state circuit breaker.
  • Parallel multi‑channel retrieval with graceful degradation.
  • Transactional RocketMQ messages, idempotency, distributed locks for remote refresh.
  • Full tracing (run/node timing, inputs/outputs) and optional Langfuse integration.
  • SSE streaming with cancel support, markdown rendering, source citation, and feedback UI.
  • Security via Sa‑Token, request throttling, parameter validation.

Developer experience

  • A React front‑end offers both a user chat UI (showing model thoughts, tool calls, citations) and an admin console for managing knowledge bases, intent trees, pipelines, users, and system settings.
  • Extensive use of classic design patterns (Strategy, Factory, Template Method, Chain of Responsibility, etc.) makes the codebase approachable for Java engineers.
  • Documentation, online demo, and quick‑start guide are provided on the project site.

Who should look at this?

  • Java backend developers who want to add AI capabilities without switching to Python.
  • Engineers preparing for interviews where RAG/Agent knowledge is expected.
  • Teams building enterprise‑grade AI assistants that need robust routing, memory, and tool integration.

Bottom line Ragent is a genuine, production‑oriented open‑source Java AI platform focused on Agentic RAG. It goes far beyond a toy demo, offering a complete, extensible stack and many of the operational safeguards needed for real‑world deployments.

Related

  • Project
  • Project
  • Project
  • Project
  • Project