Shaf Lab

Agent frameworks

Libraries that compose model calls, tools, and retrieval into an agent pipeline, such as LangChain.

An agent framework is a library that helps you wire a language model to tools, memory, and retrieval without building every loop from scratch. It typically gives you a place to register tools, a way to pass conversation or task history, and helpers for retries, tracing, and structured output. LangChain is a well-known example, but the same idea shows up in smaller, more opinionated kits.

Use a framework when you are still discovering the shape of the product and want a working loop quickly. It is less useful once the agent is the product: at that point the framework's abstractions can hide costs, make traces harder to read, and fight the exact control flow you need. Many teams start with a kit, then replace it with a thin loop they own once the tool list and memory model settle.

When you evaluate a framework, look at how it calls tools, how it stores state across turns, and how you will inspect a failed run. Prefer designs that keep the model, the tools, and the memory as separate pieces you can swap. If a kit wants to own the entire runtime, treat that as a product decision, not a default.

A practical test is to implement one real tool, one memory write, and one failure path. If that takes a day of fighting the framework, you will feel it later in production. A short, readable loop you can debug often beats a large graph of hidden callbacks.