Code librariesReviewed · langroid

Langroid

Langroid is an open-source (MIT) Python framework for building large language model (LLM) applications from cooperating agents, aimed at Python developers. Its main catch is that the README says its prompts were tested with GPT-4 and, to some extent, GPT-4o, so other LLMs may need adjustment. It covers agents, tasks, tool/function calling, retrieval-augmented question answering over documents, vector stores, MCP tool adapters and many LLM providers, and it also offers an optional Claude Code plugin.

Researched 13 Nov 2026

In short.

Langroid is an open-source (MIT) Python framework for building large language model (LLM) applications in which agents exchange messages to solve a task. It is written for Python developers. Its main catch is that the README says its built-in prompts were tested with GPT-4 and, to some extent, GPT-4o, so other LLMs may give weaker results without adjustment. Technically, an Agent holds conversation state plus an optional LLM, vector store and tools, and a Task wraps an agent, runs the loop and delegates to sub-tasks. Tools are Pydantic-based. RAG (DocChatAgent), SQL, table and graph-database agents, MCP tool adapters, caching and logging are included. This review rests only on the project README and its MIT licence file. Nothing was installed or run, so every behaviour below is as the README describes it.

Researched and written by an AI model and checked by a second AI model. How it works

Covered: the single file README.md on the repository's main branch, captured at revision 5d48dbbff1593de28975a7ec54cc9c4d10704e7b, plus the MIT LICENSE file from the same revision as its licence notice. Not covered: the rest of the repository (source code, tests, plugin files, .env-template), the documentation site, the langroid-examples repository, release notes, PyPI and community pages, and every linked page. Nothing was installed, executed or tested, so all behaviour described is as stated in the README and has not been verified.

The overview

Identity

Langroid is a Python framework for building applications powered by large language models (LLMs). The README says it comes from researchers at CMU and UW-Madison and names Prasad Chalasani and Somesh Jha as co-founders. It is published on PyPI as langroid, and the source is at [https://github.com/langroid/langroid]. Its documentation is at [https://langroid.github.io/langroid/], and a separate examples repository is at [https://github.com/langroid/langroid-examples].

The README says Langroid does not use LangChain or any other LLM framework. At the reviewed revision (5d48dbbff1593de28975a7ec54cc9c4d10704e7b), the newest release note in the README is 0.68.0 (Sep 2026). The repository also carries an optional Claude Code plugin with two skills, which the README says help a coding assistant write Langroid code. The main resource is a code library.

Assessment

On the README alone, Langroid looks like a substantial framework that is still changing, not a demo. It has a long dated release history, many integrations, a documentation site, a Colab quick start, a Docker image and a production testimonial. It suits Python developers who want a small set of abstractions (Agent, Task, ToolMessage) for multi-agent LLM apps and are willing to read the docs and examples.

Several caveats apply. The README is the project's own description, so its performance claims were not checked here. These include the 5-50x faster validation after the Pydantic V2 move and the 'far superior' remark from a Nullify executive. The README also says its prompts have been tested with GPT-4 and, to some extent, GPT-4o, and that other LLMs may give inferior results unless you adjust prompts or the multi-agent setup. Finally, recent releases include breaking changes (see Limitations), so pin a version.

Users

The intended users are Python developers who want to build LLM applications such as chatbots, document question answering, structured information extraction, data analysis assistants and multi-agent workflows. The README says you do not need to know the Actor model that inspired the design. The Colab quick-start notebook and short snippets make it approachable for newer developers who already know basic Python.

It is not aimed at people who want a ready-made chat app or a no-code builder, and the README describes no JavaScript or TypeScript version. Teams who want paid help can contact the maintainer, because the README offers consulting (advisory or development) with terms to be discussed. People who want to contribute code should note that pull requests are by invitation only.

Capabilities

Core building blocks: ChatAgent keeps conversation state, Task gives an agent its role and runs its loop, and tasks can delegate hierarchically to sub-tasks. Tools and function calling are defined with Pydantic models through ToolMessage. The README says this works with OpenAI's function-calling API and also with any LLM through Langroid's own tool format, and that XML-based tools exist. When an LLM produces malformed tool JSON, the validation error goes back to the LLM so it can retry. MCP servers can be used through a tool adapter that turns the server's tools into ToolMessage instances.

Ready-made agents: DocChatAgent answers questions over files and URLs using retrieval, with source citation. The README also lists SQLChatAgent, TableChatAgent (the LLM writes Pandas code that the agent runs), Neo4jChatAgent and ArangoDB knowledge-graph support. Listed vector stores include Qdrant, Chroma, LanceDB, Pinecone, PGVector, Weaviate and, since 0.66.0, Milvus. The README also lists many document parsers, web crawlers, search tools and several embedding options.

Model access: OpenAI models directly, and many other providers or local models through OpenAI-compatible servers and proxies such as Ollama, LiteLLM, Portkey, LangDB and OpenRouter, plus direct Gemini support. Other features the README mentions include response caching (Redis with an in-memory fake-Redis fallback, or Momento), batch and async runs, and infinite-loop detection. It also mentions max_cost and max_tokens parameters, which the README says make task runs exit when token use or cost exceeds the configured limits, and a cooperative max_time runtime budget for tasks. Detailed logs with message lineage, Chainlit callbacks and multimodal inputs (PDF, image, video) are also listed.

Using it

Requirements

Python 3.11 or newer is required, and the README recommends a virtual environment. The LLM-powered examples require access to a model. The README says the simplest start is an OpenAI API key, and that other commercial or local models are possible by following its guides. Optional pieces need their own accounts or services: Qdrant cloud, Redis Cloud or Momento for caching, a GitHub token for repo-analysis apps, and Google API and Custom Search credentials for the Google search tool.

Some platform notes come from the README. Using SQLChatAgent with PostgreSQL needs two things: the PostgreSQL development libraries for your platform (for example libpq-dev on Ubuntu or brew install postgresql on Mac) and Langroid's postgres extra (for example pip install langroid[postgres]). If that installation gives an error, the README suggests trying pip install psycopg2-binary. Milvus Lite is not available on Windows, so Windows users must point MILVUS_URI at a Milvus server or Zilliz Cloud. The Claude Code plugin needs Claude Code. Hardware needs for local models are not stated.

Mechanism

An Agent is a message transformer. By default it has three responder methods: one for the LLM, one for the Agent itself (for example running a tool handler) and one for the User. A Task wraps an agent, gives it instructions and loops over those responders. Task.run() has the same type signature as an agent's responder methods, so a parent task can treat its sub-tasks as extra responders and try them round-robin after its own. This is how hierarchical, recursive delegation works. The README also describes @-addressing, where one entity addresses another by name, and an alternative called RecipientTool.

To define a tool, you subclass ToolMessage with a request name, a purpose description the LLM sees, and typed fields. You write a method on your agent with the same name as the request, then call enable_message. The LLM emits the tool call, the agent validates it with Pydantic and runs the handler, and the result goes back into the conversation. The README gives some detail on how tool prompts are built: its May 2024 notes say a ToolMessage can supply a list of examples, each either a tool instance or a (description, tool instance) pair in which the description is a 'thought' that leads the LLM to use the tool, and that all supplied examples, rather than one random example, are used to generate few-shot examples for the LLM. In DocChatAgent, documents are chunked, embedded and stored in a vector store, and retrieved chunks are ranked and used to answer with citations. Complete prompt-construction details and other deeper internals remain unknown from the README, so those would need the source code or the documentation site.

Setup

Install the slim core with pip install langroid. Optional extras are listed: hf-embeddings for sentence-transformers embeddings, doc-chat for document parsers, db for database chat, postgres for PostgreSQL, and all for everything. The README warns that all increases install size and start-up time. Next, set OPENAI_API_KEY in a .env file or as a shell environment variable. The README tells you to copy .env-template to .env from the repository root, so that route assumes you have the repository. A Docker image, langroid/langroid:latest, packages the examples repository and reads a .env file mounted into the container.

For the Claude Code plugin, the README gives two steps: add the marketplace with claude plugin marketplace add langroid/langroid, then install with claude plugin install langroid@langroid. The same commands also work as /plugin commands inside Claude Code. The README says the plugin provides two skills: langroid:patterns, which guides the agent to write Langroid code with proper design patterns, and langroid:add-pattern, which records new patterns. How well the plugin works was not assessed.

Example

The README's quick-glimpse snippet configures an LLM with lm.OpenAIGPTConfig (for example GPT-4o, or a local model such as ollama/mistral) and calls it directly. It then uses the config in a lr.ChatAgent, which keeps state across questions. A lr.Task around the agent gives an interactive loop. For two agents, a Teacher task asks concise number questions and gives feedback, and a Student task with single_round=True answers. Calling teacher_task.add_sub_task(student_task) and then teacher_task.run() starts the loop.

The README's larger demo extracts the key terms of a commercial lease. A LeaseExtractor agent asks questions, a DocAgent answers them from a vector store and cites excerpts, and the extractor finally returns the terms in a structured function call. The README links a working script in the examples repository and a short video. It also says the snippets in the README are teasers, not complete runnable programs. For instance, the lease snippet uses json without showing its import. None of these examples were run for this review.

Assessment & evidence

Limitations

Model dependence: the README says its prompts and instructions have been tested to work well with GPT-4 and, to some extent, GPT-4o. Other LLMs may need prompt or setup changes and may give inferior results. Quality with any particular model is unknown.

Breaking and behaviour changes: 0.68.0 removed the OpenAIAssistant class because OpenAI ended the Assistants API beta, and the README points to a migration note. 0.67.0 changed environment-variable naming for vector-store configs through a per-provider env_prefix, also with a migration note. The README's changelog jumps from August 2025 (0.59.0) to August 2026 (0.66.0), so releases in between are not described there.

Safety: some agents run content generated by the LLM. TableChatAgent has the LLM write Pandas code that the agent executes. The README does not describe sandboxing for that, so treat it as untrusted code execution. 0.67.0 mentions security hardening and taint propagation, but the details are not in the README. Safety was not assessed.

Documentation and process: the README calls some material work in progress, such as the architecture overview, and says full documentation of stateless tools like Google search is coming soon. Its Highlights list of vector stores is shorter than the changelog. Pull requests are by invitation only. Performance, reliability, token cost and test results were not measured.

Reasoning

The README documents concrete APIs, installation options and examples, but whether Langroid installs cleanly and works well in practice remains unknown. The README describes specific classes and options, installation extras, environment variables, a Docker route, example repositories and a dated release log. The captured LICENSE file is the MIT License. It permits use, copying, modification, merging, publication, distribution, sublicensing and sale, provided the copyright notice and permission notice are included in all copies or substantial portions.

Three things prevent stronger conclusions. First, the README is the project's own documentation and promotion. Its claims about speed, ease of setup and superiority over CrewAI, Autogen, LangChain or Langflow come from the project and one adopter's quote and are unverified. Second, the available evidence is limited to the README and LICENSE, not the source code, tests, documentation site, issues or releases. Third, nothing was run, so install success, example output and how well Langroid works with any given model are unknown.

Alternatives

The README names CrewAI, Autogen, LangChain and Langflow as frameworks the Nullify team evaluated before adopting Langroid. They are the obvious alternatives to compare for multi-agent or LLM application work. This review has no evidence about their features and makes no head-to-head comparison. The README also says Langroid works alongside model gateways and runners such as LiteLLM, Ollama, OpenRouter and Portkey. These are ways to reach models, not replacements for the framework.

Calling an LLM provider's API directly, without a framework, is another option in principle. The README does not demonstrate it: its first snippet uses Langroid's own OpenAIGPT class. How much implementation effort and overhead that route involves compared with Langroid is unknown. According to the README, Langroid's selling points are its Agent and Task abstractions and the fact that it does not depend on another LLM framework. Whether those matter depends on your project.

Evidence

The evidence is the README.md at repository revision 5d48dbbff1593de28975a7ec54cc9c4d10704e7b (about 62 KB) and the LICENSE file at that revision (MIT). Facts about features, install steps, environment variables, release notes and the Claude Code plugin come from the README. The licence terms come from the LICENSE file.

Not checked: the actual source code, tests, the documentation site, the examples repository, PyPI metadata, download counts, GitHub issues, release notes beyond the README's summaries, and any independent reviews. Claims such as 'companies are using Langroid in production', the Nullify testimonial and the Pydantic V2 speed-up are unverified README statements.

Access & freshness

Costs

The framework can be installed from PyPI under the MIT licence, and the README mentions no licence fee. Running costs depend on what you connect to it. Possible cost categories include LLM API charges, a hosted vector store, Redis Cloud or Momento caching, and Google Custom Search. Their actual prices and any free tiers that apply are unknown, and the README gives no price figures. The README says Redis offers a free 30MB account and that Langroid falls back to an in-memory cache without Redis, but whether that offer is current is unknown. Fully local inference may avoid remote-provider API charges, but model licensing and hardware costs are unknown.

Multi-agent loops can make many LLM calls, because each agent turn that uses an LLM is a model call. The README's 0.1.235 entry says Task.run(), Task.run_async() and run_batch_tasks take max_cost and max_tokens parameters that make tasks exit when tokens or cost exceed a limit. The 0.66.0 entry adds cooperative max_time runtime budgets. It is unknown whether these act as hard spending ceilings or how far a run can go past a limit before it stops, so they do not guarantee a maximum bill. Consulting is available from the maintainer, but its price is not stated. The README also accepts sponsorship through GitHub Sponsors.

Rights

The captured LICENSE file at the same revision is the MIT License, with the copyright line 'Copyright (c) 2023 langroid'. It allows you to use, copy, modify, merge, publish, distribute, sublicense and sell copies of the software, provided the copyright notice and permission notice are included in all copies or substantial portions. The software is provided as is, without warranty.

This covers the repository's own code at that revision. The README does not state licences for the separate langroid-examples repository, the documentation site, the logo images, or the third-party packages, LLM providers and vector stores you connect. Their terms are unknown here and should be checked separately. The README's company quote and the consulting and sponsorship offers do not change the licence.

Freshness

The README's newest changelog entry is 0.68.0 (September 2026), which removed OpenAIAssistant. Before it come 0.67.0 and 0.66.0 (August 2026), and earlier entries run back to 2023. The README was captured on 13 November 2026 at the revision named above. Whether a newer release has appeared since is unknown, because the PyPI version badge is dynamic and its value was not captured.

Some README text looks older than the rest, such as the May 2024 note that gpt-4o is the default LLM, the 'tested with GPT-4' guidance, and the Highlights vector-store list, which omits Milvus. Check the documentation site and release notes for current defaults and supported models.

Actions

If you are a Python developer, a sensible first step is to open the Colab quick-start linked in the README and the Getting Started guide at [https://langroid.github.io/langroid/quick-start/]. Then read the working scripts in the langroid-examples repository at [https://github.com/langroid/langroid-examples] before writing your own.

Before you depend on it, pin an exact Langroid version and read the migration notes for 0.67.0 and 0.68.0. Test your chosen LLM on your own tasks, because the README says its prompts were tested with GPT-4 and, to some extent, GPT-4o. Set max_cost or max_tokens limits, or the cooperative max_time runtime budget, on tasks. The README says only that tasks exit when token use or cost exceeds the configured limits; whether runs can go past them is unknown, so also watch spending at your provider. Run any code-executing agent (such as TableChatAgent) in an isolated environment. Check the licences of the examples repository and of any services you integrate. If you want the Claude Code plugin, try it on a throwaway project first, since its quality was not assessed.

Evidence for this report

LICENSEnotice · checked 2026-11-13
README.mdselected · checked 2026-11-13