Lagent

github.com/InternLM/lagent AI Agent Frameworks Open-source projectOpen source

Lagent provides a lightweight framework for building agents powered by large language models.

github.com/InternLM/lagent
Lagent homepage screenshot

About Lagent

Lagent is an open-source, lightweight Python framework for building agents powered by large language models, maintained by InternLM and hosted on GitHub. It uses a PyTorch-inspired layer-based design that lets users define agent workflows by creating layers and specifying message passing between them in a Pythonic way. The framework includes built-in utilities for agent session memory management, custom LLM input message aggregation, and standardized agent message communication schemas. It supports integration with LLM models such as those run via VllmModel, and provides example code for building multi-agent applications.

Key features

  • Lightweight open-source Python framework for LLM agent development
  • PyTorch-inspired layer-based workflow for defining agent logic
  • Built-in agent session memory management with reset functionality
  • Custom message aggregation for adjusting LLM input formatting
  • Standardized AgentMessage schema for agent communication
  • Supports integration with LLM models like VllmModel
Best for: Developers building lightweight, customizable LLM-powered agent applications in Python.
Good for
  • Open-source, free to use and modify
  • Pythonic layer-based design simplifies agent workflow creation
  • Includes built-in memory and message aggregation utilities to reduce boilerplate

Lagent at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

Lagent alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in AI Agent Frameworks

Well-known listings from the same topic.

All 75

Lagent FAQ

How do you install Lagent?
Install from source by cloning the GitHub repository and running pip install -e . in the project directory.
How does Lagent manage agent session memory?
Input and output messages are automatically added to session memory, which can be inspected or reset via the agent's reset method.
Can message aggregation be customized in Lagent?
Yes, users can extend the DefaultAggregator class to implement custom aggregation for LLM input formatting.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing