LangGraph vs Chroma for AI agents: Which Should You Use?
LangGraph and Chroma solve different problems, and mixing them up leads to bad architecture. LangGraph is the orchestration layer for agent workflows: state, branching, retries, tool calls, and multi-step control flow. Chroma is the vector store for retrieval: embeddings, similarity search, metadata filtering, and persistent memory.
For AI agents, use LangGraph to control the agent and Chroma to give it memory.
Quick Comparison
| Category | LangGraph | Chroma |
|---|---|---|
| Learning curve | Higher. You need to understand graphs, state, reducers, and node routing. | Lower. You can get productive with PersistentClient, Collection, add(), and query() fast. |
| Performance | Strong for complex workflows; overhead comes from orchestration and state transitions. | Strong for embedding search and retrieval latency; optimized for vector lookup and filtering. |
| Ecosystem | Built for agent orchestration with LangChain integration, tools, checkpoints, and human-in-the-loop patterns. | Built for embeddings-first retrieval with simple local or server deployments and broad RAG usage. |
| Pricing | Open source library; your cost is infrastructure and whatever model/tool calls you make. | Open source core; self-hosting is cheap, managed usage depends on your deployment choice. |
| Best use cases | Stateful agents, multi-step decision trees, tool-using assistants, approval flows, retries. | Long-term memory, semantic search, RAG pipelines, document retrieval for agents. |
| Documentation | Good if you already think in graphs; examples are practical but assume agent-building context. | Straightforward docs focused on collections, embeddings, queries, filters, and persistence. |
When LangGraph Wins
If the problem is agent behavior, LangGraph is the right tool.
- •
You need deterministic control over multi-step reasoning
If your agent must decide between tools, call an API, validate output, then branch again based on results, use
StateGraph. A graph with explicit nodes likeplanner,retriever,tool_executor, andvalidatoris much easier to debug than a loop hidden inside a prompt. - •
You need human approval in the middle of execution
LangGraph supports interrupt-style patterns with checkpointing so a workflow can pause and resume after review. That matters in banking or insurance when an agent drafts a policy change or payment action that needs sign-off before execution.
- •
You need retries and recovery
Agent systems fail in predictable places: bad tool input, malformed model output, timeout from downstream systems. LangGraph gives you a clean place to implement retry logic at node boundaries instead of stuffing error handling into one giant prompt chain.
- •
You need stateful branching across turns
For customer service agents or claims workflows, the conversation state matters more than one-shot retrieval. LangGraph lets you carry structured state through nodes using reducers so each turn updates the workflow instead of starting from scratch.
A simple pattern looks like this:
from typing import TypedDict
from langgraph.graph import StateGraph
class AgentState(TypedDict):
question: str
answer: str
def retrieve(state: AgentState):
return {"answer": "retrieved context"}
graph = StateGraph(AgentState)
graph.add_node("retrieve", retrieve)
graph.set_entry_point("retrieve")
app = graph.compile()
That is the right shape when your agent needs explicit control flow.
When Chroma Wins
If the problem is memory or retrieval, Chroma is the right tool.
- •
You need semantic search over documents
Chroma is built for storing embeddings and querying them with similarity search. If your agent answers questions from policies, manuals, tickets, or claims notes, Chroma gives you the retrieval layer without extra ceremony.
- •
You want persistent memory with metadata filters
Agents often need scoped recall: by customer ID, product line, region, or claim status. Chroma collections support metadata filtering so you can keep retrieval tight instead of dumping everything into one global context window.
- •
You want fast local development
The
PersistentClientAPI makes it easy to run locally without standing up a separate database stack just to test retrieval behavior. That makes it ideal for prototyping agent memory before moving to production infrastructure. - •
You are building RAG first
If your “agent” is mostly answering questions from internal knowledge bases with occasional tool calls later, start with Chroma. It handles ingestion via
add(), search viaquery(), and persistence cleanly.
Example:
import chromadb
client = chromadb.PersistentClient(path="./chroma")
collection = client.get_or_create_collection(name="policies")
collection.add(
ids=["doc1"],
documents=["Claims over $10k require manager approval."],
metadatas=[{"department": "claims"}]
)
results = collection.query(
query_texts=["When do I need approval?"],
n_results=3
)
That is exactly what you want when the main job is retrieval.
For AI agents Specifically
Use LangGraph as the brain and Chroma as the memory. LangGraph should own orchestration: deciding when to retrieve, when to call tools via nodes like tool_node, when to pause for review, and when to finalize output using compile() on a StateGraph.
Chroma should sit behind a retriever node as part of that graph. If you try to use Chroma alone as an “agent,” you will end up with brittle prompt loops; if you use LangGraph without a vector store like Chroma for knowledge grounding, your agent will hallucinate its way through production data.
Keep learning
- •The complete AI Agents Roadmap — my full 8-step breakdown
- •Free: The AI Agent Starter Kit — PDF checklist + starter code
- •Work with me — I build AI for banks and insurance companies
By Cyprian Aarons, AI Consultant at Topiax.
Want the complete 8-step roadmap?
Grab the free AI Agent Starter Kit — architecture templates, compliance checklists, and a 7-email deep-dive course.
Get the Starter Kit