langroid/langroid
Harness LLMs with Multi-Agent Programming
Langroid – A lightweight Python framework for building multi‑agent LLM applications
What it is
- An open‑source Python library (originating from CMU and UW‑Madison) that lets you create, configure, and run agents powered by any large language model (LLM).
- Agents can be equipped with a language model, a vector‑store (for retrieval‑augmented generation), and custom tools/functions, then orchestrated together to solve tasks by exchanging messages.
Core ideas
- Agent – a thin wrapper around an LLM that maintains conversation state and can call tools.
- Task – a runnable unit that drives an agent (or a hierarchy of sub‑tasks) through a user‑defined loop.
- ToolMessage – a typed message that triggers a Python function (tool) from within the LLM’s reasoning.
- Multi‑agent orchestration – agents can be linked in parent/child relationships, enabling patterns like teacher‑student dialogs, tool‑delegation, or collaborative information extraction.
Key features (as listed in the README)
- Works with any OpenAI‑compatible LLM (OpenAI, Anthropic, Mistral, Gemini, local models via Ollama, etc.).
- No dependency on LangChain or other LLM frameworks – pure, self‑contained.
- Built‑in support for many vector‑stores (Qdrant, Milvus, Pinecone, pgvector, Weaviate, ArangoDB, etc.) and web‑search tools (Tavily, Exa, Firecrawl).
- Multimodal input (PDF, images, HTML, PPTX, etc.) and specialised parsers (GeminiPdfParser, docling, pymupdf4llm).
- Structured‑output enforcement via JSON schema.
- Tool‑calling with few‑shot examples, automatic handling of “forgotten” tool usage, and large‑result truncation.
- MCP (Multi‑Chat‑Protocol) tool adapter for connecting to external tool‑servers.
- Async streaming, context‑overflow truncation, task‑budget limits, and infinite‑loop detection.
- Visual HTML logger for interactive task inspection.
- Extensible plugin for Claude Code and a Docker image for multi‑arch deployment.
Typical use‑cases
- Conversational assistants that need to query a knowledge base or database.
- Retrieval‑augmented generation (DocChatAgent) for answering questions over documents.
- Structured data extraction pipelines (e.g., extracting pharmacovigilance reports).
- Multi‑agent teaching/learning simulations, tool‑delegation workflows, or any scenario where several LLMs need to coordinate.
Getting started
pip install langroid # or install extras, e.g. `pip install "langroid[doc-chat]"`
- Follow the quick‑start Colab notebook linked in the badge.
- Create a
ChatAgentConfigwith an LLM config, instantiate aChatAgent, wrap it in aTask, and calltask.run(). - For multi‑agent examples, see the companion
langroid-examplesrepo.
Documentation & community
- Full docs: https://langroid.github.io/langroid/
- Example repository: https://github.com/langroid/langroid-examples
- Discord community, Substack newsletter, and a Claude Code plugin for accelerated development.
Maturity
- Actively maintained (latest release 0.68.0, Sep 2026) with frequent feature releases, CI testing, code‑coverage, and Docker builds.
- Used in production by companies such as Nullify, with a public testimonial in the README.
License
- The repository is open source (the README does not specify a license, but the PyPI package is released under an OSI‑approved license).
Related
- Project
- Project
- Project
- Project
- Project