Repolode
wanxingai

wanxingai/LightAgent

Lightweight Python framework for building OpenAI-compatible agents with tools, memory, guardrails, tracing, hooks, multi-agent routing and workflows.

Stars
1,243
Forks
180
Open issues
2
Last commit
11 days ago

What is it?

LightAgent is a Python framework for building LLM agents that work with OpenAI-compatible models and streaming output. It is built without LangChain or LlamaIndex, and provides custom Python tools plus MCP tool integration over stdio, SSE and Streamable HTTP. Memory is pluggable, with native support for the mem0 module and per-user isolation via user_id and MemoryPolicy.

Beyond a single agent, the framework offers three orchestration layers: LightSwarm for role-based routing across specialized agents, LightFlow for deterministic multi-step DAG workflows with retries, checkpoints, resume and approval nodes, and LightDAG for persistent, dynamically verified task graphs. An optional event-sourced runtime adds durable Sessions, async execution and policy controls.

For production use, it includes input, tool and output guardrails, ordered runtime hooks, opt-in trace export, a deterministic evaluation harness, and human approval for high-risk tools. Documentation covers model provider setup for OpenRouter, vLLM, llama.cpp and other compatible endpoints.

Key features

  • 01Supports custom Python tools and MCP servers over stdio, SSE and Streamable HTTP.
  • 02Pluggable memory backends with native mem0 support and per-user isolation.
  • 03LightSwarm routes requests across role-based specialist agents.
  • 04LightFlow runs DAG workflows with retries, checkpoints, resume and approval steps.
  • 05Input, tool and output guardrails plus ordered runtime hooks for policy enforcement.
  • 06Opt-in run traces, trace export and a deterministic evaluation harness.

Use cases

  • Building a chatbot or assistant that calls internal APIs as tools.
  • Routing customer requests to specialist agents such as support, finance or HR.
  • Running multi-step workflows that need retries, checkpoints and human approval.
  • Connecting a self-hosted model such as vLLM or llama.cpp to an agent with tools.

Things to know

  • The project is pre-1.0 (v0.11.0), and its README notes an API stabilization effort, so breaking changes are possible.
  • Legacy arbitrary-Python tools are blocked in model and tool dispatch, so tools must use safe_expression or a custom isolated tool.

In collections

Topics

FAQ

What is LightAgent?
Lightweight Python framework for building OpenAI-compatible agents with tools, memory, guardrails, tracing, hooks, multi-agent routing and workflows. LightAgent is a Python framework for building LLM agents that work with OpenAI-compatible models and streaming output. It is built without LangChain or LlamaIndex, and provides custom Python tools plus MCP tool integration over stdio, SSE and Streamable HTTP. Memory is pluggable, with native support for the mem0 module and per-user isolation via user_id and MemoryPolicy.
Is LightAgent free to use? What license does it have?
LightAgent is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is LightAgent still maintained?
Actively maintained. The last commit to LightAgent was on Oct 28, 2026.
What can I use LightAgent for?
Building a chatbot or assistant that calls internal APIs as tools. Routing customer requests to specialist agents such as support, finance or HR. Running multi-step workflows that need retries, checkpoints and human approval. Connecting a self-hosted model such as vLLM or llama.cpp to an agent with tools.
Where can I get LightAgent?
The source code and installation instructions are on GitHub: https://github.com/wanxingai/LightAgent

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects