LightAgent
LightAgent is an ultra-lightweight, open-source agentic framework that supports skills, memory, tool use, and multi-agent collaboration. It solves the problem of building self-learning agents with persistent memory and complex reasoning while keeping a small footprint. It is for developers who want to quickly deploy agents with modern LLMs and integrate with MCP tools.
✨ Key features
- Lightweight and efficient, no LangChain or LlamaIndex dependencies.
- Built-in long-term memory with mem0 support and user personalization.
- Autonomous learning and self-learning from user conversations.
- Tool integration including custom tools and MCP over stdio/SSE.
- Tree of Thought reasoning for complex task decomposition.
- Multi-agent collaboration with LightSwarm and workflow orchestration with LightFlow.
🎯 Use cases
- Build a customer support agent with persistent user memory.
- Create a multi-agent system that delegates tasks to specialized agents.
- Automate complex workflows with deterministic multi-step execution.
- Integrate with MCP servers to extend agent capabilities.
- Deploy an OpenAI-compatible streaming API for chat interfaces.
📦 Installation
🧰 Requirements: Requires Python and an OpenAI-compatible LLM API key (e.g., OpenAI, DeepSeek, Qwen).
pip install lightagent
🚀 Usage
from LightAgent import LightAgent
agent = LightAgent(model="gpt-4", api_key="your-key")
response = agent.run("Hello, who are you?")
print(response)
⚠️ Good to know
Arbitrary Python execution tools are not enabled by default and require explicit opt-in with a sandbox provider; the executor is not a security sandbox.
❓ FAQ
What LLMs are supported?
LightAgent is compatible with OpenAI-style providers such as OpenAI, OpenRouter, Zhipu ChatGLM, Baichuan, StepFun, DeepSeek, Qwen, vLLM, llama.cpp, and other OpenAI-compatible endpoints.
How do I enable streaming?
Use agent.run(query, stream=True) to get OpenAI-compatible streaming chunks.
Can I use MCP tools?
Yes, LightAgent supports MCP tool integration over stdio and SSE.
Is there a way to add custom tools?
Yes, you can pass Python functions as tools to the tools parameter, and they should expose tool_info metadata.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.