# LionAGI

> LionAGI is an Intelligence Operating System for orchestrating multi-agent AI workflows from the command line or Python. It wraps any LLM provider behind a uniform Branch and Session API, with structured output, tool calling, ReAct loops, and DAG-based multi-agent flows.

When generating code that uses LionAGI, prefer these current APIs:

- `branch.operate(instruction=..., response_format=..., tools=...)` is the universal Python LLM turn: it handles tool calls, structured output, and streaming, and routes automatically to API or CLI backends. Use `branch.chat()` for raw message objects and `branch.run()` for live stream chunks. `branch.instruct()` was removed in 0.22.6.
- `Session` orchestrates multiple branches and executes DAGs via `Session.flow()`.
- The command-line entrypoint is `li`, with subcommands `agent` (one-shot subagent), `team` (inter-agent messaging), and `orchestrate` / `o` (multi-agent patterns).
- Install with `pip install lionagi` or `uv add lionagi`. Requires Python 3.10+.

## Docs
- [Install](https://ohdearquant.github.io/lionagi/getting-started/install/): install LionAGI and the `li` CLI
- [First Flow](https://ohdearquant.github.io/lionagi/getting-started/first-flow/): a minimal end-to-end example
- [Concepts](https://ohdearquant.github.io/lionagi/concepts/): Branch, Session, operate, providers, and the mental model
- [CLI Reference](https://ohdearquant.github.io/lionagi/cli-reference/): full `li agent`, `li team`, and `li orchestrate` reference

## API
- [Branch](https://ohdearquant.github.io/lionagi/api/branch/): the primary conversation and agent surface
- [Session](https://ohdearquant.github.io/lionagi/api/session/): multi-branch orchestration and `flow()`
- [Operations](https://ohdearquant.github.io/lionagi/api/operations/): operate, chat, parse, ReAct, select, communicate
- [iModel](https://ohdearquant.github.io/lionagi/api/imodel/): provider wrapper and endpoint routing
- [Flow](https://ohdearquant.github.io/lionagi/api/flow/): DAG and multi-agent execution
- [Team](https://ohdearquant.github.io/lionagi/api/team/): inter-agent messaging

## Cookbook
- [Codebase Audit](https://ohdearquant.github.io/lionagi/cookbook/codebase-audit/)
- [Research Synthesis](https://ohdearquant.github.io/lionagi/cookbook/research-synthesis/)
- [Multi-Model Pipeline](https://ohdearquant.github.io/lionagi/cookbook/multi-model-pipeline/)
- [Team Coordination](https://ohdearquant.github.io/lionagi/cookbook/team-coordination/)
- [Resumable Background](https://ohdearquant.github.io/lionagi/cookbook/resumable-background/)

## Optional
- [Providers](https://ohdearquant.github.io/lionagi/reference/providers/): supported LLM providers and configuration
- [Protocols (core)](https://ohdearquant.github.io/lionagi/reference/protocols-core/): Element, Pile, Progression, and Graph primitives
- [Agent & Hooks](https://ohdearquant.github.io/lionagi/reference/agent-hooks/): agent specs, factory, and lifecycle hooks
- [Operations & Service](https://ohdearquant.github.io/lionagi/reference/operations-service/)
- [Engines](https://ohdearquant.github.io/lionagi/reference/engines/)
- [Casts](https://ohdearquant.github.io/lionagi/reference/casts/)
- [Outcomes & Work](https://ohdearquant.github.io/lionagi/reference/outcomes-work/)
- [Testing, State & Session](https://ohdearquant.github.io/lionagi/reference/testing-state-session/)
- [Advanced](https://ohdearquant.github.io/lionagi/reference/advanced/)
- [Troubleshooting](https://ohdearquant.github.io/lionagi/reference/troubleshooting/)
- [Migration: 0.22.5 to 0.22.6](https://ohdearquant.github.io/lionagi/migration/0.22.5-to-0.22.6/)
- [Contributing](https://ohdearquant.github.io/lionagi/contributing/): development setup and guidelines
- [Source on GitHub](https://github.com/ohdearquant/lionagi): code, issues, and releases
