// the find
wanxingai/LightAgent
LightAgent: Lightweight Python framework for OpenAI-compatible agents with tools, memory, guardrails, tracing, lifecycle hooks, multi-agent collaboration, and workflows.
LightAgent is a Python agent framework from a Shanghai University research group targeting production deployments that want tools, memory, multi-agent routing, and workflow orchestration without pulling in LangChain or LlamaIndex. It works with any OpenAI-compatible endpoint and outputs OpenAI-compatible streaming, so it drops into existing chat UIs without glue code. The audience is developers building agentic applications who find larger frameworks too heavy but need more than raw API calls.
The hook system is genuinely well-designed — ordered middleware that can observe, replace, or block at named lifecycle phases (before_model_request, before_tool_call, etc.) with PolicyHook failing closed on timeout, which is the right default for security-sensitive callbacks. LightFlow's DAG workflow layer with checkpointing, resume, and per-step approval handlers solves a real problem that most lightweight agent frameworks leave to the user. The memory abstraction is pluggable and the MemoryPolicy provenance controls (namespace, trust, expiration, write admission) show serious thought about multi-tenant misuse. The test suite covers guardrails, hooks, shared memory, and tool schema validation rather than just happy-path examples.
SharedMemoryPool is in-memory and prototype-grade, but the README promotes it alongside production features without a clear warning that it evaporates on process restart — a trap for anyone who deploys it seriously. The tool metadata convention (attaching a tool_info dict to a function attribute) is fragile and non-standard; Python type annotations plus a decorator would be cleaner and catch errors earlier. The arXiv paper is from September 2025 and the framework is still pre-1.0 (v0.9.x), but the docs use language like 'production-level' throughout — that mismatch sets expectations the stability guarantees don't yet back. Chinese-language provider examples dominate the docs, which is fine, but OpenAI-compatible base URLs are scattered across examples without a single canonical configuration reference.