Lagent is a Python-based framework for building LLM-powered agents, supporting synchronous and asynchronous modes, with examples of agents, memory handling, and tool integration. Latest activity includes multiple releases up to 2026-05-19 and ongoing maintenance.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
A lightweight framework for building LLM-based agents in Python. It provides components for agents, memory management, prompts, and optional tool integration via parsers and aggregators. The project describes models as agents, memory per session, and customizable aggregators for assembling messages to send to LLMs.
How it works
Key concepts include:
- Agent: wraps an LLM interface and handles message passing between memory and model output.
- Memory: stores AgentMessage objects per session and can be dumped or reset.
- Output formatting: supports an output_format parser to structure model results.
- Aggregators: assemble a sequence of messages (and few-shot hints) into the format consumed by the LLM.
- Tool integration: ToolParser and InternLMToolAggregator enable invoking external tools and incorporating results.
- Dual interfaces: synchronous and asynchronous variants of components exist (prefix with Async).
Getting started
From README:
git clone https://github.com/InternLM/lagent.git
cd lagent
pip install -e .
The README shows usage examples constructing an Agent with an LLM, memory, and optional output_format and aggregator. A snippet demonstrates creating an Agent with a VllmModel and INTERNLM2_META meta template:
llm = VllmModel(
path='Qwen/Qwen2-7B-Instruct',
meta_template=INTERNLM2_META,
tp=1,
top_k=1,
temperature=1.0,
stop_words=['<|im_end|>'],
max_new_tokens=1024,
)
system_prompt = '你的回答只能从“典”、“孝”、“急”三个字中选一个。'
agent = Agent(llm, system_prompt)
Recent releases
Latest five releases include:
- agentrl_rc0 (2026-05-19)
- v0.5.0rc3 (2025-03-04)
- v0.5.0rc2 (2024-11-29)
- v0.5.0rc1 (2024-11-05)
- v0.2.4 (2024-10-21)
Traction
Stars: 2274 Forks: 237 Open issues: 23
Behind the repo
Not provided in the facts.
Caveats
License: Apache-2.0
Created: 2023-08-20
Last push: 2026-08-03
Topics include agent, gpt, llm, transformers. The README includes other details about usage patterns, memory, and code examples related to aggregators and tool parsers. The repository is Python-based and installed from source with pip install -e . after cloning.






