lovia¶
lovia is a lightweight Python agent framework. Start with one Agent and a few
lines of Python; add tools, streaming, persistence, a workspace, or a web UI
only when you need them.
Configure an endpoint in Quickstart: configure a model,
then replace <model> below with a model name exposed by that endpoint.
from lovia import Agent
agent = Agent(
name="assistant",
instructions="Answer clearly and concretely.",
model="<model>",
)
print(agent.run_sync("Why is the sky blue?").output)
Complete your first run → Open the Web UI →
Start from your goal¶
| I want to… | Start with | Then explore |
|---|---|---|
| Run my first agent | Quickstart | Core concepts |
| Connect a model or gateway | Configure a model | Providers & models |
| Let the model call code | Tools | Built-in tools |
| Read files or run commands | Workspace | Tool approvals |
| Preserve conversations or resume work | Sessions & checkpoints | Context management |
| Compose multiple agents | Multi-agent | Plugins |
| Build a chat application | Web UI | Web server · HTTP API |
| Test agent behavior | Testing | Evals · Observability |
lovia's tradeoffs¶
- The core depends only on
httpx,pydantic, andpyyaml; integrations are optional. Agentholds configuration only; the run loop owns mutable state for each run.- Context compaction changes the model view, not this run's transcript; configured limits may still truncate oversized Tool output.
- Skills, MCP, Todo, Memory, and custom capabilities share the plugin extension point.
Learn from examples¶
The examples are ordered by difficulty and run independently:
01_hello.py: first run02_tools.py: tool calls03_streaming.py: streaming events04_structured_output.py: structured output05_sessions.py: conversation history- All examples
Version
This site follows main and may be newer than your installed package. Run
python -c "import lovia; print(lovia.__version__)" to check your local version.
Read the architecture notes before changing framework internals.
中文文档:docs/zh。