Your agent framework will outlive your time at the client
Anthropic advises starting with direct API calls, so picking LangChain, LlamaIndex or Haystack really means deciding which layer to hand to someone else's library.
In brief
- Anthropic advises starting by calling the LLM API directly, because many patterns need only a few lines of code, and warns that frameworks can obscure the underlying prompts.
- The four tools serve four different layers: LangChain for getting started fast, LlamaIndex for the data layer, Haystack for explicit pipelines, RAGFlow for complex documents.
- For an FDE, the framework stays in the client's codebase after you leave, so bring one in only when it carries real work that you understand well.
In its guide to building agents, published on December 19, 2024, Anthropic offered advice that runs against what many developers do by reflex: start by calling the LLM API directly. The reasoning is practical. Many patterns need only a few lines of code.
Every framework, meanwhile, makes its own promise. Haystack describes itself as an open-source framework for building production-ready agents. LangChain promises to get agents running quickly with any model provider. LlamaIndex invites you to build agents on your organization’s own data.
For a Forward Deployed Engineer, picking a framework is more than a matter of taste. The code you write stays in the client’s codebase after you leave, and the client’s team is the one debugging it at two in the morning.
So the right question is not “which framework is best” but “where is the client stuck, and should that part be handed to someone else’s library?”
Each tool solves a different part of the job
Read closely how each project describes itself and it becomes clear they are playing on different fields. LangChain puts the emphasis on fast startup and on working with any model provider. When you need production agents with a degree of determinism, it points you to a separate product, LangGraph, which offers low-level control.
LangChain also has LangSmith, a platform for observing, evaluating and deploying agents. That detail matters to an FDE: part of this ecosystem is a product the client may have to buy, on top of the open-source library. When you recommend LangChain, spell out which pieces the client is using and which could bring costs later.
LlamaIndex starts from data: a Python toolkit for building LLM-powered agents that run on the client’s own data. Its workflows are event-driven, multi-step processes that combine agents, data connectors and tools. RAG is one tool among several in that picture.
Haystack does not hide logic behind automatic layers. According to deepset’s documentation, a pipeline is a graph you wire yourself, so it runs the same way every time. The project stresses explicit control over retrieval, routing, memory and generation, and promises that you can swap models or infrastructure without rewriting the system.
RAGFlow sits apart from the others: it is a ready-made RAG engine you deploy and run, where the rest are libraries you assemble in code. Its strength is deep understanding of unstructured documents with complex formatting. It also lets users see visually how documents are split into chunks, so a person can step in.
The table below places each tool in situations that come up often on client sites:
| Tool | Strong at | Fits when the client needs | Question to ask before bringing it in |
|---|---|---|---|
| LangChain + LangGraph | Fast startup, works with many providers; LangGraph for production that needs determinism | A quick demo to win over decision-makers, then a move to a controlled flow | Will the client use LangSmith, and who pays? |
| LlamaIndex | Agents on private data, event-driven workflows, many data connectors | Data scattered across many sources | Which connectors are really needed, and which aren’t yet? |
| Haystack | Pipelines the developer wires, consistent runs, swappable models and infrastructure | Audits, reproducible results, fear of lock-in | Does the client’s team have the people to maintain that graph? |
| RAGFlow | Prebuilt engine, understands complex documents, chunking you can inspect and fix | A messy PDF archive, with business staff checking retrieval quality | Will they accept running a separate system instead of a library? |
| Direct API calls | Fewest intermediate layers, full view of every prompt | Simple flows that need fast debugging | Which parts are you rewriting that a framework already solves well? |
Where is the client stuck?
Take a hypothetical case: a logistics company wants an internal agent that answers questions about shipping contracts. The data is a few thousand scanned PDFs with tables, drafted from different templates over the years. You have two weeks.
In the first week you call the API directly, split documents into fixed-length chunks and print the full prompt before every request. A user asks for the storage fee on the Hai Phong–Hanoi route, and the model answers wrongly. The printed prompt (illustrative figures) looks like this:
Context:
[Chunk 15] Hai Phong - Hanoi | 4,200,000 | 350,000
[Chunk 31] Storage fees are charged monthly, payable at the end of the period...
Question: What is the storage fee for the Hai Phong - Hanoi route?
The fault is visible at once. The header row, “Route | Shipping fee | Storage fee”, fell into chunk 14, which was never retrieved, so the model saw two numbers with no column names and picked the first one. The problem sits in how the documents were read and chunked. Agent orchestration has nothing to do with it.
That is the moment to bring in a tool built for document understanding, such as RAGFlow. Its chunk-inspection screen lets someone on the operations side see that the fee table was cut off from its header and adjust it so the whole table sits in one chunk. Print the prompt again and the context now carries every column name, and the model picks the correct figure, 350,000.
The lesson for day one on a client site: before discussing frameworks, print the prompt and ask whether the retrieved chunks contain enough for a human reader to answer correctly.
Other situations lead to other tools. If the documents are clean but scattered across SharePoint, databases and email, LlamaIndex’s data layer is the part that saves you effort.
Suppose instead the client is an audited business that needs every answer to be reproducible. Then Haystack’s hand-wired graph, which runs the same way each time, will be easier to defend in front of the compliance team.
If the client’s boss only needs a demo in three days to approve a budget, a quick start with LangChain makes sense, as long as you say up front that production will need LangGraph or another approach.
You leave, and the client carries the abstraction
Anthropic names the biggest risk: frameworks often add layers of abstraction that obscure the underlying prompts, making debugging harder. For a developer building an internal product, that is a minor annoyance. For an FDE, it is a debt left with the client’s team.
Anthropic’s second piece of advice is blunter: if you use a framework, understand the code underneath. It notes that incorrect assumptions about what is happening inside are a common source of customer error. In practice, the error usually starts with someone who believes the framework is doing one thing when it is doing another.
That gives every framework a test to pass before handover. Can you print the exact final prompt sent to the model, as in the shipping-contract example above? Can the client’s team trace a wrong answer back to the exact chunk and the exact routing step that caused it?
If the answer is no, the framework is saving you time by making the client pay later.
Writing it yourself does not mean rewriting everything
Reading Anthropic’s advice as “never use a framework” misreads it. The claim is that many patterns need only a few lines of code, and “many” leaves room for the rest. A tool-calling loop, a summarization step or a simple router each fits in a few dozen lines that anyone on the client’s team can read.
Writing your own parser for PDFs full of tables, or your own connectors for ten data sources, means redoing work that RAGFlow or LlamaIndex have invested heavily in. Haystack’s promise of “swap the model without rewriting” is also only worth something if the client can realistically switch models.
If not, a thin adapter layer you write yourself is enough to reduce the risk of lock-in.
The sensible approach on a client site is therefore usually a mix. Write the orchestration yourself and keep it very thin, enough to print every prompt. Bring a framework in at exactly one heavy layer, where it carries real work. At handover, include a page explaining why that layer uses a library and the others do not.
What developers should practice
The skill that pays here is explaining, in front of the client’s engineers, why this tool fits this part of the job; memorizing the APIs of all four tools counts for little. Practice by solving the same problem two ways, with direct API calls and with a framework, then note where the framework helped and where it hid the prompt.
Framework names in job descriptions are clues too: a role that mentions LangGraph and observability most likely needs someone to take agents into production under control. When describing your experience, show recruiters how you weighed using or dropping a tool; a bare list of library names tells them little.
Frameworks will rename themselves, merge products and change how they pitch themselves. The habit of calling the API directly first, finding exactly where the client is stuck and only then choosing a tool will outlast any of them.
Was this article useful?
Thanks for the feedback!