How to Build an Enterprise AI Agent: Complete Guide
TL;DR — The 2026 Enterprise Agent Blueprint A demo agent is a prompt + search tool. A production agent is 4 layers: Memory/State → Retrieval (RAG / RAG Graph / Knowledge Graph) → Tools (read vs write with human approval) → Orchestration (LangGraph loop with bounded retry + evaluation). RAG, RAG Graph & Knowledge Graph are not separate products — they are three retrieval tools inside one agent, routed per question. Build order: plain RAG → RAG Graph loop → Knowledge Graph (only for relationship questions) → gated actions → evaluation/observability — not full autonomy on day one. Stack 2026: LangGraph + Qdrant/Weaviate/pgvector + BGE-M3 + Neo4j + LangMem/Graphiti. Quick Definition (for Featured Snippet) An enterprise AI agent is a reasoning loop (Think → Act via tools → Observe → Decide) built on 4 layers: 1) Memory & State (AgentState), 2) Retrieval (RAG / RAG Graph / Knowledge Graph), 3) Tools (typed schemas, write actions require human approval), 4) Orchestration (LangGraph state graph withMAX_ITERATIONS + is this actually done? checkpoint). Enterprise readiness = data residency + evaluation + observability + cost — designed in from day one.
Why this matters in 2026: Retrieval is the #1 agent failure — not the LLM. Teams that ship a "bigger model" instead of a better retrieval architecture ship fragile agents. This living guide (last reviewed August 2026) connects our RAG Graph and Knowledge Graph deep-dives into one zero-to-enterprise system with code skeleton, open-source GitHub stack per layer, and a build order that avoids paying for complexity you haven't earned.
Table of Contents
Most people's first "agent" is a chatbot with a system prompt and access to a search tool. It works in a demo. It falls apart the moment someone asks it something that requires more than one step, or the moment it needs to make a decision instead of just answering a question.
An agent that actually works — the kind that can be trusted to run inside a business, on real data, making real decisions — is a different kind of system entirely. This guide builds one from zero, using everything a real enterprise deployment actually needs: not just an LLM with a prompt, but memory, tools, retrieval, verification, and the judgment to know when it doesn't know something.
By the end, the RAG, RAG Graph, and Knowledge Graph concepts you may already know aren't three separate systems anymore — they're three tools inside one agent's toolbox, and you'll know exactly when the agent should reach for which. In short: A production agent is four layers — memory/state, retrieval, tools, and orchestration — not a prompt with a search tool attached. RAG, RAG Graph, and Knowledge Graph all live inside the retrieval layer, selected based on the question being asked, not adopted wholesale. Write actions need human approval; an explicit "is this actually done?" checkpoint prevents both premature stopping and infinite loops; and enterprise readiness (data residency, evaluation, observability, cost) has to be designed in from day one, not retrofitted after an incident. This guide covers the full architecture, a working code skeleton, an open-source stack for every layer, and a build order that avoids adding complexity before it's earned.
Last reviewed: August 2026. This guide is maintained as a living reference — architecture principles are stable; the open-source stack section (Part 9) is the part most likely to need updates as tooling evolves.
Part 1: What "Agent" Actually Means (And What It Doesn't)
Before building anything, it's worth being precise about a word that gets used loosely.
A chatbot with a system prompt answers questions. You ask, it responds, conversation over. It has no memory of decisions, no ability to take multi-step action, and no way to check whether its own answer was actually right.
An agent does something meaningfully different: it can decide what to do, take actions using tools, observe the results of those actions, and decide what to do next based on what it just learned — in a loop, until the task is actually finished, not just until it's produced a plausible-sounding response.
Task
↓
Think: what does this need?
↓
Act: use a tool
↓
Observe: what came back?
↓
Think again: is this enough? ──No──→ Act again
↓ Yes
Respond
This loop — often called the reasoning loop or, more formally, patterns like ReAct (Reason + Act) — is the actual definition of an agent. Everything else in this guide is about making that loop reliable, safe, and useful enough to trust with real work.
Why "enterprise-level" changes the requirements
A weekend agent project needs to work once, for you, in a demo. An enterprise agent needs to:
- Work correctly on questions it's never seen before, not just the ones you tested.
- Fail safely and visibly, instead of confidently producing a wrong answer.
- Respect data boundaries — who can see what, and where the data is allowed to live.
- Be debuggable when something goes wrong, weeks after it went wrong.
- Handle real-world messiness: incomplete information, ambiguous requests, conflicting sources.
Every section below is building toward those five requirements specifically, not just "an agent that responds."
Part 2: The Four Layers Every Real Agent Needs
Strip away the specific technology choices, and every production-grade agent is built from four layers stacked on top of each other.
┌─────────────────────────────────────┐
│ 4. Orchestration (the workflow) │
├─────────────────────────────────────┤
│ 3. Tools (what it can DO) │
├─────────────────────────────────────┤
│ 2. Retrieval (what it KNOWS) │
├─────────────────────────────────────┤
│ 1. Memory & State (what it │
│ REMEMBERS) │
└─────────────────────────────────────┘
We'll build this from the bottom up, because each layer depends on the one beneath it.
Part 3: Layer 1 — Memory and State
An agent with no memory re-derives everything from scratch on every single step, which is slow, expensive, and loses track of what it already figured out three steps ago. Real agents carry state.
Two different kinds of memory, and they're easy to conflate
Short-term (working) memory is the state of the current task — what was asked, what's been tried, what's been found so far, what's still missing. This lives only for the duration of one task and disappears when it's done.
Long-term memory persists across separate sessions entirely — facts the agent should remember about a user, a project, or a client relationship, days or months later.
At the code level, this is usually implemented as a state object that gets passed between every step of the agent's workflow and updated as it goes:
AgentState:
original_task: "..."
steps_taken: [...]
evidence_gathered: [...]
tools_called: [...]
current_confidence: "sufficient" | "insufficient"
This state object is the backbone everything else attaches to. Every tool call reads from it and writes back to it. Without it, an agent has no way to know it already tried something, or to build on a partial answer instead of starting over.
Part 4: Layer 2 — Retrieval (What the Agent Actually Knows)
This is where the earlier deep dives on RAG, RAG Graph, and Knowledge Graphs stop being separate blog posts and start being components you select from, based on what kind of knowledge your agent needs to access.
Not every agent needs all three
This is the single most common mistake in agent design: reaching for the most sophisticated retrieval architecture available instead of the one the actual task needs.
| If your agent needs to... | Reach for... |
|---|---|
| Answer questions from a document set, one passage at a time | Plain RAG |
| Answer multi-part or comparative questions across many documents | A RAG Graph |
| Answer relationship questions ("which," "how many," "trace the connection") | A Knowledge Graph, called as a tool |
| All of the above, depending on the question | A RAG Graph that can call both a vector store and a knowledge graph |
The retrieval layer is not "the agent." It's one of the agent's tools — the one specifically responsible for answering "what do I actually know about this." Everything from the earlier guides — chunking, embeddings, entity resolution, evidence validation — lives inside this one layer.
Agent's Retrieval Tool
↓
Question Analysis
↓
┌────┴────┐
↓ ↓
Vector Knowledge
Search Graph
↓ ↓
└────┬────┘
↓
Evidence Validation
↓
Grounded Facts
This whole block — everything covered in the earlier RAG Graph and Knowledge Graph guides — is a single tool call from the agent's perspective. The agent doesn't need to know how retrieval works internally; it just needs to know it can ask this tool a question and get back grounded facts, or an honest "not enough evidence found."
Part 5: Layer 3 — Tools (What the Agent Can Actually Do)
Retrieval answers questions. Tools take actions. An enterprise agent that can only answer questions is still just a smarter search box. The step that turns it into something that "works for you" is giving it the ability to actually do things — send an email, create a ticket, query a live database, call an internal API, update a record.
Designing tools an agent can actually use well
Each tool needs three things clearly defined, or the agent will misuse it:
- A precise description of exactly what it does and when to use it — vague descriptions cause an agent to call the wrong tool, or the right tool with wrong inputs.
- A narrow, well-typed input schema — the agent should never have to guess what format a tool expects.
- A predictable, structured output — if a tool sometimes returns text and sometimes returns JSON and sometimes fails silently, the agent can't reliably use its output in the next step.
The critical distinction: read tools vs. write tools
This matters enormously for enterprise deployments specifically:
- Read/retrieval tools (search a knowledge base, look up a record, check a status) are generally safe to let an agent call freely — no real-world consequence if it calls one unnecessarily.
- Write/action tools (send an email, delete a record, approve a request, spend money) need a human-in-the-loop checkpoint before execution, especially early in a deployment's life. The agent proposes the action; a human confirms it; only then does it execute.
Agent decides: "I should send this email"
↓
Draft prepared, NOT sent
↓
Human reviews
↓
┌─────┴─────┐
↓ ↓
Approve Reject
↓ ↓
Sent Agent revises
This single design choice is often the difference between an agent teams actually trust in production and one that gets shut off after the first embarrassing mistake.
Part 6: Layer 4 — Orchestration (The Actual Workflow)
This is the layer that ties memory, retrieval, and tools together into the reasoning loop from Part 1 — and it's exactly the same category of thing as the RAG Graph from earlier, just applied to a broader task than "answer a question." This is most commonly built with a graph-based workflow framework (LangGraph is the standard choice here), because a real agent's behavior isn't a straight line — it branches, loops, and revises based on what it learns at each step.
Task Received
↓
Understand & Plan
↓
┌──┴───────────────┐
↓ ↓
Need info? Need action?
↓ ↓
Call retrieval Call a tool
↓ ↓
└────────┬─────────┘
↓
Evaluate progress
↓
Task actually done?
/ No Yes
↓ ↓
Loop back Respond
Why the evaluation step is not optional
Just like the evidence-validation step in a RAG Graph, an enterprise agent needs an explicit checkpoint that asks: is the task actually complete, or does it just look finished? Without this, agents have a well-documented failure mode of declaring success prematurely — stopping after a partial result because nothing forced them to check their own work.
This is also where bounded retries matter. An agent stuck in an unproductive loop, calling the same tool with slightly different inputs forever, is a real and common failure mode. Every loop needs a maximum iteration count and a defined fallback: if the agent can't complete the task after N attempts, it should say so clearly, rather than either looping forever or fabricating a result to escape the loop.
What this looks like as actual code
The diagram above maps directly onto a LangGraph state machine. This is a minimal skeleton — real production nodes would call your actual retrieval and tool functions, but the shape below is the whole pattern:
from typing import TypedDict, Literal
from langgraph.graph import StateGraph, END
class AgentState(TypedDict):
task: str
steps_taken: list
evidence: list
iterations: int
done: bool
MAX_ITERATIONS = 5
def plan(state: AgentState) -> AgentState:
# LLM decides: retrieve more info, call a tool, or respond
...
return state
def retrieve(state: AgentState) -> AgentState:
# Calls the retrieval layer (RAG / RAG Graph / Knowledge Graph tool)
...
return state
def call_tool(state: AgentState) -> AgentState:
# Write actions pause here for human approval before executing
...
return state
def evaluate(state: AgentState) -> AgentState:
# The "is this actually done?" checkpoint from above
state["iterations"] += 1
...
return state
def route_after_evaluate(state: AgentState) -> Literal["plan", "respond"]:
if state["done"] or state["iterations"] >= MAX_ITERATIONS:
return "respond"
return "plan" # loop back — bounded by MAX_ITERATIONS
graph = StateGraph(AgentState)
graph.add_node("plan", plan)
graph.add_node("retrieve", retrieve)
graph.add_node("call_tool", call_tool)
graph.add_node("evaluate", evaluate)
graph.add_node("respond", lambda s: s)
graph.set_entry_point("plan")
graph.add_edge("plan", "retrieve")
graph.add_edge("plan", "call_tool")
graph.add_edge("retrieve", "evaluate")
graph.add_edge("call_tool", "evaluate")
graph.add_conditional_edges("evaluate", route_after_evaluate, {
"plan": "plan",
"respond": "respond",
})
graph.add_edge("respond", END)
agent = graph.compile()
Pattern Link: This LangGraph skeleton mirrors the RAG Graph workflow (validation + bounded retry) — same graph pattern, broader toolset.
The two details worth not skipping when you build the real version: MAX_ITERATIONS is what turns "loop until done" into "loop until done, or until it's honest about not being done" — never ship a loop without this. And call_tool is where the human-approval checkpoint from Part 5 belongs for any write action — in LangGraph this is typically implemented with an interrupt that pauses the graph and waits for external confirmation before the node completes.
Part 7: Putting the Whole Agent Together
Here's the complete architecture, all four layers assembled into one system:
┌─────────────────────┐
│ Incoming Task │
└──────────┬───────────┘
↓
┌─────────────────────┐
│ ORCHESTRATION │
│ (plan, loop, decide) │
└──────────┬───────────┘
↓
┌────────────────┼────────────────┐
↓ ↓
┌─────────────────────┐ ┌──────────────────────┐
│ RETRIEVAL LAYER │ │ TOOLS LAYER │
│ ┌─────┐ ┌────────┐ │ │ Read tools (free) │
│ │ RAG │ │Knowledge│ │ │ Write tools (needs │
│ │ │ │ Graph │ │ │ human approval) │
│ └─────┘ └────────┘ │ └──────────────────────┘
└─────────────────────┘
↓ ↓
└────────────────┬─────────────────┘
↓
┌─────────────────────┐
│ STATE / MEMORY │
│ (tracks everything │
│ across the whole │
│ task) │
└──────────┬───────────┘
↓
┌─────────────────────┐
│ Task complete? │
│ No → loop back │
│ Yes → respond │
└─────────────────────┘
Notice what this diagram actually shows: the RAG Graph and Knowledge Graph from the earlier guides are not the whole system — they're one box inside a larger one. The agent is the orchestration layer around them, deciding when retrieval is even the right move versus when an action needs to be taken instead.
Part 8: The Enterprise-Specific Concerns Nobody Puts in Tutorials
This is where most agent tutorials stop, and where most real deployments actually live or die.
Data residency and where processing happens
For regulated industries (legal, healthcare, finance) or any organization under GDPR, where each layer runs matters as much as how well it works. Self-hosting the retrieval layer — running your own embedding model, your own vector database, your own fine-tuned extraction model, your own Neo4j instance, on infrastructure you control — means client data never leaves your boundary at any stage. This is a real architectural decision, not an afterthought: it determines whether you can even serve certain clients at all.
Evaluation — how do you know it's actually working?
An agent that "seems to work" in casual testing and an agent that's been properly evaluated are very different levels of trustworthy. A real evaluation set means:
- A curated collection of realistic tasks, with known-correct outcomes, that the agent is tested against before every meaningful change ships.
- Tracking not just "did it get the right answer" but "did it correctly identify when it didn't have enough information" — an agent that never says "I don't know" is not more capable, it's less honest.
- Re-running this evaluation set regularly, not just once at launch, since small changes to a prompt or a tool can silently break behavior elsewhere.
Observability — what happens when it goes wrong at 2am
See: Full tracing/evals/drift setup in LLM Observability in Production — the discipline that catches silent quality drift where dashboards stay green.Every state transition, every tool call, every retrieval, and every decision point needs to be logged in a way a human can reconstruct after the fact. This is the difference between "the agent made a mistake and we can see exactly why" and "the agent made a mistake and we have no idea what happened." An append-only, replayable log of every step an agent took on a given task — not just the final answer — is not a nice-to-have at enterprise scale; it's what makes the system debuggable at all.
Cost, at real usage volume
An agent that loops, retries, and calls multiple tools per task can rack up far more LLM calls per user request than a simple chatbot. Before deploying broadly, actually measure: how many LLM calls does one typical task take, end to end? What does that cost at expected usage volume? This is the same throughput-and-cost thinking that matters when building the knowledge graph's extraction pipeline — know your real numbers before you scale, not after.
Part 9: The Open-Source Stack, Mapped to Each Layer
Everything above is architecture. This section is the actual toolbox — real, self-hostable open-source options for each of the four layers, so this stops being theoretical.
Orchestration layer
LangGraph is the standard choice for exactly the branching, looping, stateful workflow described in Part 6 — it's a graph-based orchestration framework built specifically for this pattern, not a general agent wrapper. Alternatives worth knowing: CrewAI (role-based multi-agent teams, faster to prototype, less fine-grained control over branching logic) and AutoGen (Microsoft's multi-agent conversation framework). For most single-agent enterprise workflows with real branching and retry logic, LangGraph remains the most direct fit.
Retrieval layer — vector search
For self-hosted vector search, Qdrant is a strong operationally-efficient starting point for single-node self-hosted deployments — a single binary, low query latency, and a clean API, which is why it shows up repeatedly in compliance-sensitive deployments where embeddings are generated inside a secure perimeter with a locally deployed model so no data leaves the building at any stage. Weaviate is the strongest alternative if you want hybrid search and reranking modules built into the database itself rather than as separate services, and Milvus is worth considering specifically at billion-vector scale. If you're already running PostgreSQL, pgvector keeps embeddings in the same database as the rest of your data, trading some raw performance for transactional consistency and one less system to operate.
For embeddings, self-hostable models like BGE-M3 or nomic-embed-text run locally through Ollama or sentence-transformers, avoiding any per-call API cost or data leaving your infrastructure — directly relevant if data residency is a hard requirement.
For reranking, BGE-reranker (open weights, self-hostable) is the standard open-source cross-encoder choice; Cohere Rerank is the equivalent managed option if self-hosting isn't a requirement.
Retrieval layer — knowledge graph construction
This is where tooling has matured fastest. A few genuinely different options, not just competing brands of the same idea:
- Neo4j's GraphRAG ecosystem (the
neo4j-graphrag-pythonpackage plus the LLM Knowledge Graph Builder) is the first-party path if you're already committed to Neo4j as your graph database — it handles chunking, entity/relationship extraction, and loading in one pipeline, with a reference UI for visualizing what got extracted.
- LightRAG is a lighter-weight alternative that chunks documents, uses an LLM to extract entities and relationships, builds the graph, and combines graph traversal with vector retrieval automatically. Notably for your case, it supports open-source models for every step, so extraction can run entirely on local infrastructure to keep sensitive data on-premises, and as of March 2026 it supports Neo4j, MongoDB, PostgreSQL, and OpenSearch as storage backends.
- Microsoft GraphRAG is the heavier, more academically-grounded option — stronger at producing community-level summaries over large graphs, but it needs to re-cluster the entire graph when new data arrives, which matters if you're doing frequent incremental updates rather than periodic full rebuilds.
For extraction quality specifically: independent benchmarking on domain-specific reasoning found real spread in construction cost and quality across these tools — LightRAG and GraphRAG both showed high token costs for graph construction relative to methods like HippoRAG or G-Retriever, so it's worth piloting on a real sample of your documents before committing to one at full scale, exactly as covered in Part 3 of the Knowledge Graph guide.
Memory layer
This category has genuinely separated into distinct tools depending on what "memory" needs to mean for your agent — worth not defaulting to whichever one is most talked about, since they solve different problems:
- LangMem is the natural first choice if your orchestration is already LangGraph — the integration is a first-party SDK rather than a third-party plugin, so it adds no new infrastructure or vendor relationship. Its tradeoff is real ecosystem lock-in and a narrower feature set than the standalone options below.
- Mem0 is the most broadly adopted standalone option, combining vector, graph, and key-value storage with automatic memory extraction — a reasonable general-purpose default if you want an agent to remember user preferences and facts across sessions without deep temporal reasoning.
- Graphiti (built by the Zep team) is the right choice specifically when facts genuinely change over time and that history matters — every edge carries a validity interval, so it correctly handles facts like a person's role changing from one company to another over time. This is a meaningfully different capability from the other options, not just a variant of the same thing.
- Cognee positions itself as a more modular, graph-native memory engine — composable pipelines for ingesting and querying memory, with support for multiple graph backends. Worth evaluating if you want more architectural control over how memory is structured rather than a fixed schema.
- Letta (formerly MemGPT) is the strongest fit for long-running agents that need OS-style explicit memory tiering — deciding what stays in active context versus what gets moved to longer-term storage, rather than treating memory as one flat store.
For your specific situation — self-hosted, GDPR-oriented, already LangGraph-native — the practical starting point is LangMem for short-term/working memory (since it's already native to your orchestration layer) plus Graphiti or Cognee for long-term memory if your clients' use cases involve facts that change over time (contract amendments, case status updates, evolving client relationships) — both are fully open-source and self-hostable with no cloud dependency required.
One honest caution before you pick anything
Some frameworks are open-core with advanced features — knowledge graph capabilities in particular — gated behind paid tiers, so verify what's actually included in the license you intend to self-host under before committing architecture decisions to a specific tool. This is a five-minute check that saves a rebuild later.
Part 10: A Realistic Build Order
Here's the order that actually works, going from a working prototype to something enterprise-ready, without building unnecessary complexity too early.
1. Start with a single tool and no loop. Just retrieval, plain RAG, answering questions from documents. Get this genuinely reliable before adding anything else. 2. Add the reasoning loop, but keep it to read-only tools. Let the agent decide when to retrieve and whether it has enough — this is the RAG Graph pattern from earlier, and it's worth mastering on its own before adding action tools. 3. Add a knowledge graph as a retrieval tool (Neo4j + GraphRAG / LightRAG), only once you've observed real questions that plain retrieval structurally can't answer — see build blueprint in Knowledge Graphs Explained — relationship questions, not just lookup ones. 4. Add write/action tools, gated behind human approval. Don't let the agent take consequential actions autonomously until you've built real trust in its judgment through the earlier stages. 5. Add evaluation and observability before scaling usage — not after something goes wrong. This is the stage most teams skip, and the one that determines whether problems get caught early or discovered by an angry client. 6. Only then consider full autonomy for write actions, and only for the specific, narrow categories of action where the cost of a mistake is genuinely low.
Part 11: Pre-Launch Checklist
A condensed, practical checklist — use this to audit an agent before it goes in front of real users, not just as a reading summary.
Architecture
- [ ] Every tool has a precise description, a narrow typed input schema, and a predictable structured output.
- [ ] Read tools and write tools are explicitly separated in code, not just in documentation.
- [ ] Every write/action tool requires human approval before execution.
- [ ] The orchestration loop has a hard maximum iteration count with a defined, honest fallback response.
- [ ] There is an explicit "is this task actually complete?" node — the agent never treats "produced an output" as equivalent to "solved the task."
Retrieval
- [ ] You've confirmed which retrieval tool(s) — vector search, knowledge graph, or both — actually fit your users' real questions, based on observed usage, not assumption.
- [ ] Evidence validation exists as a distinct step before generation; the agent can say "not enough information" instead of always answering.
- [ ] If using a knowledge graph, entity resolution has been tested on a real sample of your data, not just the extraction step.
Enterprise readiness
- [ ] You know exactly where each layer's data lives, and whether that satisfies your actual compliance requirement (not just "self-hosted sounds compliant").
- [ ] A real evaluation set exists — realistic tasks with known-correct outcomes — and is re-run before every meaningful change ships.
- [ ] Every state transition, tool call, and retrieval is logged in a way a human can reconstruct after the fact, weeks later.
- [ ] You've measured real LLM-calls-per-task and projected actual cost at expected usage volume — not estimated it.
- [ ] Licenses have been checked for every framework in your stack, especially memory and graph tooling where advanced features are sometimes paywalled even in "open-source" projects.
Glossary
Agent — A system that decides what to do, takes actions via tools, observes results, and decides what to do next in a loop, rather than producing one response to one input.
Orchestration layer — The workflow logic (commonly built in LangGraph) that governs branching, looping, and retries across an agent's task.
Retrieval layer — The part of an agent responsible for answering "what do I actually know about this," typically composed of RAG, a RAG Graph, and/or a knowledge graph.
RAG (Retrieval-Augmented Generation) — Retrieving relevant text via similarity search and handing it to a language model to answer from, in a single linear pass.
RAG Graph — A LangGraph workflow layer wrapped around RAG's components that adds decomposition, parallel retrieval, evidence validation, and retries — improving reliability on multi-part questions without improving the underlying embeddings, reranking, or generation.
Knowledge graph — A Neo4j data store of entities (nodes) and explicit, typed relationships (edges) between them, queried by traversal rather than similarity.
Entity resolution — The process of recognizing that different mentions ("Case A," "Case No. A-2019") refer to the same real-world entity, so facts about it from different documents connect into one node instead of staying disconnected.
Evidence validation — An explicit checkpoint that judges whether retrieved information is actually sufficient to answer a question, before generation proceeds.
Human-in-the-loop — A design pattern where an agent proposes an action but a human must approve it before it executes, used for any action with real-world consequences.
Working (short-term) memory — State that persists only for the duration of one task: what's been tried, what's been found, what's still missing.
Long-term memory — State that persists across separate sessions — facts about a user, project, or relationship remembered days or months later.
Sources & Further Reading
This guide draws on current tooling documentation and independent benchmarking as of August 2026:
- Neo4j GraphRAG Ecosystem Tools — official documentation on graph-based retrieval-augmented generation
- Neo4j GraphRAG for Python (GitHub) — first-party Python library for Neo4j-backed GraphRAG
- LightRAG overview — lightweight graph-based RAG with open-source model support throughout its pipeline
- GraphRAG-Bench — benchmark comparing graph construction cost and quality across GraphRAG, LightRAG, HippoRAG, and other methods
- Best Open-Source Vector Databases 2026 — comparison of Milvus, Qdrant, Weaviate, Chroma, pgvector, and others
- Self-Hosted Vector Database Rankings 2026 — compliance-focused self-hosted deployment analysis
- AI Agent Memory Frameworks Compared 2026 — comparison of Mem0, Zep/Graphiti, LangMem, Letta, and others
- AI Agent Memory Tools & Alternatives 2026 — practical selection guidance and licensing notes across memory frameworks
- Open Source Graph RAG Tools 2026 — direct comparison of Graphiti, Cognee, LightRAG, and GraphRAG by use case
Companion pieces in this series: Stop Confusing RAG, RAG Graph, and Knowledge Graph (architecture comparison), Inside a RAG Graph: How AI Systems Learn to Check Their Own Work, and Knowledge Graphs Explained: How AI Learns to Connect the Dots.
Key Takeaways
- An agent is defined by a loop — think, act, observe, decide again — not by having an LLM answer questions with a system prompt.
- Every real agent is built from four layers: memory/state, retrieval, tools, and orchestration — and the RAG, RAG Graph, and Knowledge Graph concepts all live inside the retrieval layer, not as the whole system.
- Read tools can generally be called freely; write tools that take real-world action need a human-in-the-loop checkpoint, especially early in deployment.
- An explicit "is this task actually done?" checkpoint, with bounded retries, is what prevents an agent from either quitting too early or looping forever.
- Enterprise readiness isn't a feature you add at the end — data residency, evaluation, observability, and cost need to be designed in from the start, not bolted on after something breaks.
- Build in order: retrieval first, then the reasoning loop, then knowledge graph if you actually need relationship queries, then gated actions, then evaluation and observability — before, not after, scaling usage.