December 16, 2025 in agents, architecture by Thomas Hedan5 minutes
A comparison of Fred’s graph-centric RAG agent (Richard) and reflective RAG agent (Rico), including architecture and evaluation metrics.
In Fred, the agentic-backend is the core of the AI capabilities. It is a Python server orchestrating intelligent agents using FastAPI and LangGraph, capable of reasoning, interacting with documents, and generating answers from external knowledge.
Among these agents, there are classic RAG (Retrieval-Augmented Generation) mechanisms — such as Rico — as well as more advanced concepts explored with Richard, combining graphiti / graphrag and OpenAI.
In Fred, a RAG agent is not just a rigid pipeline query → retrieval → generation as in traditional RAG systems. Instead, it is an agentic workflow in which:
This approach is inspired by Agentic RAG, a paradigm in which the agent actively makes decisions throughout the RAG process, rather than relying on a static RAG pipeline.
Rico is Fred’s document expert agent. In simple terms:
It implements a loop inspired by Self-RAG, where, if the answer is deemed insufficient, the query is rewritten and the process is retried.
The internal architecture of a RAG agent in Fred (i.e., retrieval → grading → generation → answer grading → retry) is expressed with LangGraph, making Rico modular, declarative, and observable.
What Rico does particularly well:
Richard explores another dimension of RAG:
Instead of considering only text snippets, Richard structures knowledge as semantic graphs.
This graph links entities, concepts, and passages, and can be exploited for logical multi-hop reasoning (e.g., “How is X related to Y through Z?”).
This type of pipeline corresponds to what is commonly referred to as GraphRAG or graph-centric RAG, where structured relationships enrich both retrieval and generation.
The core idea behind graphrag is to use graph structures to go beyond simple vector search, capture complex relationships between entities and concepts, improve contextual relevance, and reduce hallucinations.
The knowledge flow processes items one by one, but GraphRAG needs a complete corpus to build a coherent graph. In Fred terms, that corpus is a library. To support this, the author designed a library-level output processor that runs on an entire library, uses graphiti to extract entities and relations, and loads them into Neo4j. This ingestion step is packaged as a separate application rather than embedded in Knowledge Flow, keeping the architecture modular and avoiding dependency conflicts. It also makes it easy to launch the ingestion as an on-demand Kubernetes job when a library needs to be processed. Once the graph is built, a dedicated controller exposes an MCP interface that Richard uses for graph-aware retrieval.
%%{init: {"themeVariables": {"fontSize": "16px"}}}%%
flowchart LR
subgraph KF["Knowledge Flow"]
KFLib["Library (full corpus)"]
end
subgraph GOP["Graph Output Processor App"]
Graphiti["Graphiti extraction"]
Neo4j["Neo4j graph store"]
end
subgraph MCP["Graph MCP Controller"]
MCPApi["MCP Interface"]
end
subgraph AB["Fred Agentic Backend"]
Richard["Richard (GraphRAG agent)"]
end
KFLib -->|"library-level output"| Graphiti
Graphiti -->|"entities + relations"| Neo4j
Neo4j -->|"graph queries"| MCPApi
Richard -->|"graph retrieval"| MCPApi
style KF fill:#E9FFE9,stroke:#2E6B2E,stroke-width:1.2px
style GOP fill:#FFF7E6,stroke:#7A4A21,stroke-width:1.2px
style MCP fill:#E6F7FF,stroke:#1C6B8A,stroke-width:1.2px
style AB fill:#FFEFE0,stroke:#7A4A21,stroke-width:1.2px
style KFLib fill:#F4FFF4,stroke:#2E6B2E,stroke-dasharray: 5 4
style Graphiti fill:#FFF2CC,stroke:#6B5A1F,stroke-width:1.4px
style Neo4j fill:#E2F0FF,stroke:#1C6B8A,stroke-width:1.2px
style MCPApi fill:#E6F7FF,stroke:#1C6B8A,stroke-width:1.2px
style Richard fill:#FFD9B3,stroke:#7A4A21,stroke-width:1.4px
| Criterion | Rico (Reflective Self-RAG) | Richard (Graph-centric / GraphRAG) |
|---|---|---|
| Type of RAG | Agentic RAG based on re-retrieval, reranking, grading | GraphRAG — RAG enriched with knowledge graphs |
| Agentic decision-making | Yes, autonomous reflective loop | Yes, with graph traversal for contextualization |
| Knowledge management | Vector store + grading + retrieval | Entity graphs with explicit relationships |
| Best suited for | Precise, robust factual answers | Multi-step reasoning / conceptual links |
| Explainability | Traceability of reranking and phases | Explicit graph structures linking concepts |
| Complexity | Moderate | High (graph construction and exploitation) |
In practice:
Beyond architectural differences, Richard (GraphRAG) and Rico (reflective RAG with reranking) were evaluated through a series of comparative tests, directly aligned with the use cases of Fred’s agentic backend.
Both agents were submitted to the same queries, on the same corpus, with evaluation based on two key metrics:
Each test directly compares GraphRAG vs RAG, with a win / tie / loss verdict from the perspective of GraphRAG.
| Metric | GraphRAG (Richard) | RAG (Rico) |
|---|---|---|
| Faithfulness score | 0.7945 | 0.7419 |
| Answer relevancy score | 0.8781 | 0.8127 |
The performance of Richard (GraphRAG) and Rico (reflective RAG) was evaluated on a set of 47 comparative tests, conducted on the same corpus with identical queries. The results are analyzed from the perspective of GraphRAG, using win / tie / loss verdicts.
| Metric | GraphRAG wins | Ties | Losses | Weighted win rate |
|---|---|---|---|---|
| Faithfulness score | 20 | 14 | 13 | 57.4 % |
| Answer relevancy score | 17 | 21 | 9 | 58.5 % |
Across both evaluated metrics, GraphRAG achieves a win rate above 57%, indicating a systematic advantage over a classic RAG enriched with reranking and self-evaluation.
The faithfulness score shows that GraphRAG more frequently produces answers better grounded in the sources, suggesting reduced drift associated with purely text-based context aggregation.
The answer relevancy score confirms a better alignment between the generated answer and the intent of the question, particularly for queries involving multiple documents or implicit relationships.