MCPcopy
hub / github.com/langroid/langroid

github.com/langroid/langroid @0.65.7 sqlite

repository ↗ · DeepWiki ↗ · release 0.65.7 ↗
3,665 symbols 20,047 edges 433 files 1,630 documented · 44%
README

Logo

PyPI - Version Downloads Pytest codecov Multi-Architecture DockerHub

Static Badge Open in Colab Discord Substack

Documentation · Examples Repo · Discord · Contributing

Langroid is an intuitive, lightweight, extensible and principled Python framework to easily build LLM-powered applications, from CMU and UW-Madison researchers. You set up Agents, equip them with optional components (LLM, vector-store and tools/functions), assign them tasks, and have them collaboratively solve a problem by exchanging messages. This Multi-Agent paradigm is inspired by the Actor Framework (but you do not need to know anything about this!).

Langroid is a fresh take on LLM app-development, where considerable thought has gone into simplifying the developer experience; it does not use Langchain, or any other LLM framework, and works with practically any LLM.

🔥 ✨ A Claude Code plugin is available to accelerate Langroid development with built-in patterns and best practices.

🔥 Read the (WIP) overview of the langroid architecture, and a quick tour of Langroid.

🔥 MCP Support: Allow any LLM-Agent to leverage MCP Servers via Langroid's simple MCP tool adapter that converts the server's tools into Langroid's ToolMessage instances.

📢 Companies are using/adapting Langroid in production. Here is a quote:

Nullify uses AI Agents for secure software development. It finds, prioritizes and fixes vulnerabilities. We have internally adapted Langroid's multi-agent orchestration framework in production, after evaluating CrewAI, Autogen, LangChain, Langflow, etc. We found Langroid to be far superior to those frameworks in terms of ease of setup and flexibility. Langroid's Agent and Task abstractions are intuitive, well thought out, and provide a great developer experience. We wanted the quickest way to get something in production. With other frameworks it would have taken us weeks, but with Langroid we got to good results in minutes. Highly recommended!

-- Jacky Wong, Head of AI at Nullify.

🔥 See this Intro to Langroid blog post from the LanceDB team

🔥 Just published in ML for Healthcare (2024): a Langroid-based Multi-Agent RAG system for pharmacovigilance, see blog post

We welcome contributions: See the contributions document for ideas on what to contribute.

Are you building LLM Applications, or want help with Langroid for your company, or want to prioritize Langroid features for your company use-cases? Prasad Chalasani is available for consulting (advisory/development): pchalasani at gmail dot com.

Sponsorship is also accepted via GitHub Sponsors

Questions, Feedback, Ideas? Join us on Discord!

Quick glimpse of coding with Langroid

This is just a teaser; there's much more, like function-calling/tools, Multi-Agent Collaboration, Structured Information Extraction, DocChatAgent (RAG), SQLChatAgent, non-OpenAI local/remote LLMs, etc. Scroll down or see docs for more. See the Langroid Quick-Start Colab that builds up to a 2-agent information-extraction example using the OpenAI ChatCompletion API. See also this version that uses the OpenAI Assistants API instead.

🔥 just released! Example script showing how you can use Langroid multi-agents and tools to extract structured information from a document using only a local LLM (Mistral-7b-instruct-v0.2).

import langroid as lr
import langroid.language_models as lm

# set up LLM
llm_cfg = lm.OpenAIGPTConfig( # or OpenAIAssistant to use Assistant API 
  # any model served via an OpenAI-compatible API
  chat_model=lm.OpenAIChatModel.GPT4o, # or, e.g., "ollama/mistral"
)
# use LLM directly
mdl = lm.OpenAIGPT(llm_cfg)
response = mdl.chat("What is the capital of Ontario?", max_tokens=10)

# use LLM in an Agent
agent_cfg = lr.ChatAgentConfig(llm=llm_cfg)
agent = lr.ChatAgent(agent_cfg)
agent.llm_response("What is the capital of China?") 
response = agent.llm_response("And India?") # maintains conversation state 

# wrap Agent in a Task to run interactive loop with user (or other agents)
task = lr.Task(agent, name="Bot", system_message="You are a helpful assistant")
task.run("Hello") # kick off with user saying "Hello"

# 2-Agent chat loop: Teacher Agent asks questions to Student Agent
teacher_agent = lr.ChatAgent(agent_cfg)
teacher_task = lr.Task(
  teacher_agent, name="Teacher",
  system_message="""
    Ask your student concise numbers questions, and give feedback. 
    Start with a question.
    """
)
student_agent = lr.ChatAgent(agent_cfg)
student_task = lr.Task(
  student_agent, name="Student",
  system_message="Concisely answer the teacher's questions.",
  single_round=True,
)

teacher_task.add_sub_task(student_task)
teacher_task.run()

🔥 Updates/Releases

Click to expand

  • Aug 2025:
  • 0.59.0 Complete Pydantic V2 Migration - 5-50x faster validation, modern Python patterns, 100% backward compatible.
  • Jul 2025:
  • 0.58.0 Crawl4AI integration - browser-based web crawling with Playwright for JavaScript-heavy sites, no API key required (thank you @abab-dev!).
  • 0.57.0 HTML Logger for interactive task visualization - self-contained HTML logs with collapsible entries, auto-refresh, and persistent UI state.
  • Jun 2025:
  • 0.56.0 TaskTool for delegating tasks to sub-agents - enables agents to spawn sub-agents with specific tools and configurations.
  • 0.55.0 Event-based task termination with done_sequences - declarative task completion using event patterns.
  • 0.54.0 Portkey AI Gateway support - access 200+ models across providers through unified API with caching, retries, observability.
  • Mar-Apr 2025:
  • 0.53.0 MCP Tools Support.
  • 0.52.0 Multimodal support, i.e. allow PDF, image inputs to LLM.
  • 0.51.0 LLMPdfParser, generalizing GeminiPdfParser to parse documents directly with LLM.
  • 0.50.0 Structure-aware Markdown chunking with chunks enriched by section headers.
  • 0.49.0 Enable easy switch to LiteLLM Proxy-server
  • 0.48.0 Exa Crawler, Markitdown Parser
  • 0.47.0 Support Firecrawl URL scraper/crawler - thanks @abab-dev
  • 0.46.0 Support LangDB LLM Gateway - thanks @MrunmayS.
  • 0.45.0 Markdown parsing with Marker - thanks @abab-dev
  • 0.44.0 Late imports to reduce startup time. Thanks @abab-dev
  • Feb 2025:
  • 0.43.0: GeminiPdfParser for parsing PDF using Gemini LLMs - Thanks @abab-dev.
  • 0.42.0: markitdown parser for pptx,xlsx,xls files Thanks @abab-dev.
  • 0.41.0: pinecone vector-db (Thanks @coretado), Tavily web-search (Thanks @Sozhan308), Exa web-search (Thanks @MuddyHope).
  • 0.40.0: pgvector vector-db. Thanks @abab-dev.
  • 0.39.0: ChatAgentConfig.handle_llm_no_tool for handling LLM "forgetting" to use a tool.
  • 0.38.0: Gemini embeddings - Thanks @abab-dev)
  • 0.37.0: New PDF Parsers: docling, pymupdf4llm
  • Jan 2025:
  • 0.36.0: Weaviate vector-db support (thanks @abab-dev).
  • 0.35.0: Capture/Stream reasoning content from Reasoning LLMs (e.g. DeepSeek-R1, OpenAI o1) in addition to final answer.
  • 0.34.0: DocChatAgent chunk enrichment to improve retrieval. (collaboration with @dfm88).
  • 0.33.0 Move from Poetry to uv! (thanks @abab-dev).
  • 0.32.0 DeepSeek v3 support.
  • Dec 2024:
  • 0.31.0 Azure OpenAI Embeddings
  • 0.30.0 Llama-cpp embeddings (thanks @Kwigg).
  • 0.29.0 Custom Azure OpenAI Client (thanks @johannestang).
  • 0.28.0 ToolMessage: _handler field to override default handler method name in request field (thanks @alexagr).
  • 0.27.0 OpenRouter Support.
  • 0.26.0 Update to latest Chainlit.
  • 0.25.0 True Async Methods for agent and user-response (thanks @alexagr).
  • Nov 2024:
  • 0.24.0: Enables support for Agents with strict JSON schema output format on compatible LLMs and strict mode for the OpenAI tools API. (thanks @nilspalumbo).
  • 0.23.0: support for LLMs (e.g. Qwen2.5-Coder-32b-Instruct) hosted on glhf.chat
  • 0.22.0: Optional parameters to truncate large tool results.
  • 0.21.0 Direct support for Gemini models via OpenAI client instead of using LiteLLM.
  • 0.20.0 Support for ArangoDB Knowledge Graphs.
  • Oct 2024:
  • [0.18.0] LLMConfig.async_stream_quiet flag to turn off LLM output in async + stream mode.
  • [0.17.0] XML-based tools, see [docs](https://langro

Core symbols most depended-on inside this repo

enable_message
called by 428
langroid/agent/chat_agent.py
run
called by 316
langroid/agent/task.py
set_global
called by 264
langroid/utils/configuration.py
get
called by 264
langroid/utils/object_registry.py
split
called by 151
langroid/parsing/parser.py
default_value
called by 112
langroid/agent/tool_message.py
name
called by 92
langroid/agent/tool_message.py
info
called by 89
langroid/language_models/base.py

Shape

Method 1,572
Function 1,308
Class 747
Route 38

Languages

Python100%

Modules by API surface

tests/main/test_tool_messages.py114 symbols
langroid/agent/base.py73 symbols
langroid/parsing/document_parser.py69 symbols
langroid/agent/chat_agent.py67 symbols
tests/main/test_task.py66 symbols
langroid/agent/task.py62 symbols
langroid/language_models/openai_gpt.py59 symbols
langroid/language_models/base.py58 symbols
tests/main/test_mcp_tools.py56 symbols
langroid/agent/special/doc_chat_agent.py44 symbols
langroid/agent/openai_assistant.py43 symbols
langroid/embedding_models/models.py42 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

exa-py1.8.7 · 1×
fastmcp2.2.5 · 1×
google-genai1.0.0 · 1×
httpx0.28.1 · 1×
markdownify0.13.1 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add langroid \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact