Practical overview
When it fits
Use Lagent when you need Python-level control over agent construction, message flow or conversation state, rather than a ready-to-use hosted chat service.
Who it is for
- Python developers building custom LLM-based agents.
- Teams prototyping multi-agent applications or custom message flows.
Documented uses
- Connect an agent to a language model and send it structured messages.
- Retain, inspect and reset the messages stored in an agent's memory.
- Customize how conversation history and few-shot examples are assembled for a model.
Requirements & limits
The project is available as a public GitHub repository and lists an Apache-2.0 license. The README documents installation from source with pip.
- The documented workflow is Python code and editable installation from the repository.
- The example configures a VllmModel and a Qwen model path; model setup is a separate consideration from installing Lagent.
- The README includes examples for inspecting and resetting message memory and customizing aggregation.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Lagent from its source repository
Clone the repository and install Lagent in editable mode.
Before you start
- A working Git and Python environment with pip.
Steps
Clone https://github.com/InternLM/lagent.git.
Change into the lagent directory.
Run pip install -e .
Expected outcome
The repository README's source-installation procedure is complete.
Guide limitations
- This setup procedure does not configure or run a model-backed agent.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 October 2026
- Original website title
- InternLM/lagent · Official homepage title · retained in its source language

