An Intelligence Operating System.
Project description
lionagi
Orchestrate multi-agent AI workflows from the command line or Python.
Docs | Discord | PyPI | Changelog
Lion Studio
Lion Studio is the built-in web UI for managing and operating your agent workflows. Projects, schedules, playbooks, shows, and runs — all in one place.
pip install lionagi
# Option 1: Docker (recommended — one command, no Node.js needed)
li studio # auto-pulls ghcr.io/ohdearquant/lion-studio
# UI → http://localhost:3000 API → http://localhost:8765
# Option 2: From source (for development)
git clone https://github.com/ohdearquant/lionagi.git && cd lionagi
pip install ".[studio]"
li studio --dev # starts backend + frontend with hot reload
What's New in 0.26
- Lion Studio — web UI for orchestrating agent workflows: projects, scheduled runs, execution DAGs, branch inspection, and multi-agent monitoring.
- Project management (ADR-0026) — per-repo
.lionagi/config.tomlfor project identity. Sessions auto-group by project.--project NAMEflag on all CLI commands. - Scheduled runs (ADR-0027) — cron, interval, and GitHub-poll triggers with DAG-based conditional chains (
on_fail/on_success). Studio becomes an active operator, not just a monitor. - Agent infrastructure —
AgentConfigpresets (.coding(),.research()) with built-in permission policies, hooks, and tool registration viacreate_agent(). - Sandbox tool —
SandboxSessionuses git worktrees for isolated editing:create()→ edit →diff()→commit()→merge()ordiscard().
Install
pip install lionagi
CLI provider auth — CLI aliases spawn subprocess tools, not REST API calls:
claude: install Claude Code CLI →claude login(subscription) orexport ANTHROPIC_API_KEY=sk-ant-...(API key)codex: requires ChatGPT Plus/Pro →npm install -g @openai/codex→codex logindeepseek:export DEEPSEEK_API_KEY=sk-...for DeepSeek modelspi: install Pi Code CLI for Pi models- Python API (
iModel,Branch):export OPENAI_API_KEY=sk-...for gpt-4.1-mini default
First Flow
import asyncio
from lionagi import Branch
async def main():
b = Branch() # default: gpt-4.1-mini (requires OPENAI_API_KEY)
reply = await b.communicate("Name 3 features of async Python, one sentence each.")
print(reply)
asyncio.run(main())
# output:
1. Coroutines let you write non-blocking I/O without threads.
2. asyncio.gather runs multiple coroutines concurrently under one event loop.
3. async generators stream results lazily, pausing between each yield.
For multi-agent orchestration without Python, see CLI Quick Start.
Concepts
| Term | What it is |
|---|---|
| Branch | Single conversation thread — message history, tools, model config. Primary API surface. |
| Session | Coordinates multiple Branches; runs DAG workflows across them. |
| flow | li o flow — orchestrator plans a DAG, workers execute with dependency edges resolved. |
| team | Persistent inbox messaging between agents via li team send/receive. |
| operate | branch.operate(instruction=…) — tool use + structured output + optional streaming. |
| persist | Every run saved to ~/.lionagi/runs/{run_id}/. Resume with li agent -r <branch-id>. |
| AgentConfig | Preset agent configurations (coding, research) with permission policies, hooks, and tool registration. |
| Sandbox | Git worktree isolation for safe experimentation — SandboxSession.create() → edit → diff → merge or discard. |
CLI — li
# Single agent
li agent claude/sonnet "Explain the observer pattern in 3 sentences"
# Fan-out: N workers in parallel, optional synthesis
li o fanout claude/sonnet "Identify code smells in this codebase" -n 3 --with-synthesis
# DAG flow: orchestrator plans agents with dependency edges
li o flow claude/sonnet "Audit the auth module for security issues" --cwd .
# Team messaging: inbox coordination between agents
li team create "review" && li team send "Start analysis" -t <id> --to analyst
# Playbook: parametric flow spec at ~/.lionagi/playbooks/audit.playbook.yaml
li play audit --mode security "the auth service"
li play NAME --help # Show playbook parameters and usage
# Skill: print a CC-compatible reference body to stdout (for agent context injection)
li skill commit
# Resume any run
li agent -r <branch-id> "follow up on your findings"
# Time-bounded run: injects a [DEADLINE] preamble so the agent paces its own reasoning
li agent claude/sonnet --timeout 300 "Audit the auth module and produce a summary"
Full reference → docs/cli-reference.md · Installable templates → examples/
Python API
Chat
from lionagi import Branch
b = Branch(chat_model="openai/gpt-5.4", system="You are a concise assistant.")
reply = await b.communicate("What causes rainbows?")
Structured output
from pydantic import BaseModel
class Summary(BaseModel):
points: list[str]
confidence: float
result = await b.operate(instruction="Summarize this text.", response_format=Summary)
Tools + ReAct
from lionagi.tools.types import ReaderTool
branch = Branch(tools=[ReaderTool])
result = await branch.ReAct(
instruct={"instruction": "Summarize /path/to/paper.pdf"},
)
Full reference → docs/api/
Docs
| Getting Started | Install, first flow, API key setup |
| Concepts | Branch, Session, flow, team, operate, persist |
| CLI Reference | li agent, li o fanout, li o flow, li team — all flags |
| Cookbook | 5 runnable scenarios: codebase audit, research synthesis, multi-model pipeline, team coordination, resumable background run |
| API Reference | branch.operate, branch.ReAct, iModel, Session |
| Migration 0.22.5 → 0.22.6 | Breaking changes: branch.instruct removed, run paths changed |
| Contributing | Dev setup, PR workflow |
Optional Extras
uv add "lionagi[reader]" # Document reading (PDF, HTML, DOCX)
uv add "lionagi[mcp]" # MCP server support
uv add "lionagi[ollama]" # Local models via Ollama
uv add "lionagi[rich]" # Rich terminal output
uv add "lionagi[graph]" # Flow visualization
uv add "lionagi[postgres]" # PostgreSQL persistence
uv add "lionagi[all]" # Everything
Claude Code Marketplace
The lionagi marketplace provides installable Claude Code plugins for the lionagi agent runtime. Each plugin adds a focused set of skills and agents for a specific workflow: structured show runs, memory management, playbook authoring, developer tooling, and multi-agent orchestration.
Install:
claude /plugin marketplace add ohdearquant/lionagi
Prerequisites: lionagi (pip install lionagi or uv pip install lionagi) and Claude Code installed.
See marketplace/README.md for the full plugin list and per-plugin install instructions.
Community
- Discord — questions, ideas, help
- Issues — bugs and feature requests
- Contributing — PR workflow
Citation
@software{Li_LionAGI_2023,
author = {Haiyang Li},
year = {2023},
title = {LionAGI: Towards Automated General Intelligence},
url = {https://github.com/ohdearquant/lionagi},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lionagi-0.26.7.tar.gz.
File metadata
- Download URL: lionagi-0.26.7.tar.gz
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be0e271d8e20e16598a0abb8e0ef39b8bdf398c8b90448d7654fc5cc716c6c87
|
|
| MD5 |
42f96a63f3ac7aa557be7934aee079c6
|
|
| BLAKE2b-256 |
5c280fb8487ec2c4304fa917350c185782bf97bdfe6e88106a3dc7389cce7d69
|
File details
Details for the file lionagi-0.26.7-py3-none-any.whl.
File metadata
- Download URL: lionagi-0.26.7-py3-none-any.whl
- Upload date:
- Size: 703.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f217204fe13e5b8f8efe304af1bbd8c7ea53e9a592076a3ba56cfff389269695
|
|
| MD5 |
49c78c14d13d48c186c5042f2a303244
|
|
| BLAKE2b-256 |
d54d684d518d20ebebdcfad5f21b185bec2d17912eece690608cc562dabc2e9c
|