{"id":31921196,"url":"https://github.com/khive-ai/lionagi","last_synced_at":"2026-05-03T01:12:35.530Z","repository":{"id":205436140,"uuid":"705957157","full_name":"khive-ai/lionagi","owner":"khive-ai","description":"AGI SDK","archived":false,"fork":false,"pushed_at":"2026-02-14T00:50:08.000Z","size":33159,"stargazers_count":382,"open_issues_count":11,"forks_count":71,"subscribers_count":12,"default_branch":"main","last_synced_at":"2026-02-14T07:50:11.135Z","etag":null,"topics":["agents","ai","automation","data","llm","machine-learning","workflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khive-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["lion-agi"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2023-10-17T03:10:02.000Z","updated_at":"2026-02-14T00:49:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"0cb580c7-7317-4021-aff0-f2192a17f2d1","html_url":"https://github.com/khive-ai/lionagi","commit_stats":null,"previous_names":["lion-agi/lionagi","khive-ai/lionagi"],"tags_count":192,"template":false,"template_full_name":null,"purl":"pkg:github/khive-ai/lionagi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khive-ai%2Flionagi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khive-ai%2Flionagi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khive-ai%2Flionagi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khive-ai%2Flionagi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khive-ai","download_url":"https://codeload.github.com/khive-ai/lionagi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khive-ai%2Flionagi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30222593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","automation","data","llm","machine-learning","workflow"],"created_at":"2025-10-13T22:31:54.438Z","updated_at":"2026-05-03T01:12:35.523Z","avatar_url":"https://github.com/khive-ai.png","language":"Python","funding_links":["https://github.com/sponsors/lion-agi"],"categories":["Python"],"sub_categories":[],"readme":"\n![PyPI - Version](https://img.shields.io/pypi/v/lionagi?labelColor=233476aa\u0026color=231fc935)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/lionagi?color=blue)\n![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)\n[![codecov](https://codecov.io/github/khive-ai/lionagi/graph/badge.svg?token=FAE47FY26T)](https://codecov.io/github/khive-ai/lionagi)\n\n# lionagi\n\nOrchestrate multi-agent AI workflows from the command line or Python.\n\n[Docs](https://khive-ai.github.io/lionagi/) |\n[Discord](https://discord.gg/JDj9ENhUE8) |\n[PyPI](https://pypi.org/project/lionagi/) |\n[Changelog](CHANGELOG.md)\n\n## What's New in 0.23\n\n- **Agent infrastructure** — `AgentConfig` presets (`.coding()`, `.research()`) with built-in permission policies, hooks, and tool registration via `create_agent()`.\n- **Sandbox tool** — `SandboxSession` uses git worktrees for isolated editing: `create()` → edit → `diff()` → `commit()` → `merge()` or `discard()`.\n- **New providers** — DeepSeek (`DEEPSEEK_API_KEY`) and Pi (via [Pi Code CLI](https://pi.ai)) are now supported as CLI agent backends.\n- **Settings merge** — global `~/.lionagi/settings.yaml` and per-project `.lionagi/settings.yaml` are merged automatically at startup.\n\n## Install\n\n```bash\npip install lionagi\n```\n\n**CLI provider auth** — CLI aliases spawn subprocess tools, not REST API calls:\n\n- `claude`: install [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) → `claude login` (subscription) or `export ANTHROPIC_API_KEY=sk-ant-...` (API key)\n- `codex`: requires ChatGPT Plus/Pro → `npm install -g @openai/codex` → `codex login`\n- `deepseek`: `export DEEPSEEK_API_KEY=sk-...` for DeepSeek models\n- `pi`: install [Pi Code CLI](https://pi.ai) for Pi models\n- Python API (`iModel`, `Branch`): `export OPENAI_API_KEY=sk-...` for gpt-4.1-mini default\n\n## First Flow\n\n```python\nimport asyncio\nfrom lionagi import Branch\n\nasync def main():\n    b = Branch()          # default: gpt-4.1-mini (requires OPENAI_API_KEY)\n    reply = await b.communicate(\"Name 3 features of async Python, one sentence each.\")\n    print(reply)\n\nasyncio.run(main())\n```\n\n```text\n# output:\n1. Coroutines let you write non-blocking I/O without threads.\n2. asyncio.gather runs multiple coroutines concurrently under one event loop.\n3. async generators stream results lazily, pausing between each yield.\n```\n\nFor multi-agent orchestration without Python, see [CLI Quick Start](docs/getting-started/first-flow.md).\n\n## Concepts\n\n| Term | What it is |\n|------|------------|\n| **Branch** | Single conversation thread — message history, tools, model config. Primary API surface. |\n| **Session** | Coordinates multiple Branches; runs DAG workflows across them. |\n| **flow** | `li o flow` — orchestrator plans a DAG, workers execute with dependency edges resolved. |\n| **team** | Persistent inbox messaging between agents via `li team send/receive`. |\n| **operate** | `branch.operate(instruction=…)` — tool use + structured output + optional streaming. |\n| **persist** | Every run saved to `~/.lionagi/runs/{run_id}/`. Resume with `li agent -r \u003cbranch-id\u003e`. |\n| **AgentConfig** | Preset agent configurations (coding, research) with permission policies, hooks, and tool registration. |\n| **Sandbox** | Git worktree isolation for safe experimentation — `SandboxSession.create()` → edit → diff → merge or discard. |\n\n## CLI — `li`\n\n```bash\n# Single agent\nli agent claude/sonnet \"Explain the observer pattern in 3 sentences\"\n\n# Fan-out: N workers in parallel, optional synthesis\nli o fanout claude/sonnet \"Identify code smells in this codebase\" -n 3 --with-synthesis\n\n# DAG flow: orchestrator plans agents with dependency edges\nli o flow claude/sonnet \"Audit the auth module for security issues\" --cwd .\n\n# Team messaging: inbox coordination between agents\nli team create \"review\" \u0026\u0026 li team send \"Start analysis\" -t \u003cid\u003e --to analyst\n\n# Playbook: parametric flow spec at ~/.lionagi/playbooks/audit.playbook.yaml\nli play audit --mode security \"the auth service\"\nli play NAME --help                          # Show playbook parameters and usage\n\n# Skill: print a CC-compatible reference body to stdout (for agent context injection)\nli skill commit\n\n# Resume any run\nli agent -r \u003cbranch-id\u003e \"follow up on your findings\"\n```\n\nFull reference → [docs/cli-reference.md](docs/cli-reference.md) · Installable\ntemplates → [examples/](examples/)\n\n## Python API\n\n**Chat**\n\n```python\nfrom lionagi import Branch\n\nb = Branch(chat_model=\"openai/gpt-5.4\", system=\"You are a concise assistant.\")\nreply = await b.communicate(\"What causes rainbows?\")\n```\n\n**Structured output**\n\n```python\nfrom pydantic import BaseModel\n\nclass Summary(BaseModel):\n    points: list[str]\n    confidence: float\n\nresult = await b.operate(instruction=\"Summarize this text.\", response_format=Summary)\n```\n\n**Tools + ReAct**\n\n```python\nfrom lionagi.tools.types import ReaderTool\n\nbranch = Branch(tools=[ReaderTool])\nresult = await branch.ReAct(\n    instruct={\"instruction\": \"Summarize /path/to/paper.pdf\"},\n)\n```\n\nFull reference → [docs/api/](docs/api/)\n\n## Docs\n\n| | |\n|--|--|\n| [Getting Started](docs/getting-started/first-flow.md) | Install, first flow, API key setup |\n| [Concepts](docs/concepts.md) | Branch, Session, flow, team, operate, persist |\n| [CLI Reference](docs/cli-reference.md) | `li agent`, `li o fanout`, `li o flow`, `li team` — all flags |\n| [Cookbook](docs/cookbook/) | 5 runnable scenarios: codebase audit, research synthesis, multi-model pipeline, team coordination, resumable background run |\n| [API Reference](docs/api/) | `branch.operate`, `branch.ReAct`, `iModel`, `Session` |\n| [Migration 0.22.5 → 0.22.6](docs/migration/0.22.5-to-0.22.6.md) | Breaking changes: `branch.instruct` removed, run paths changed |\n| [Contributing](docs/contributing.md) | Dev setup, PR workflow |\n\n## Optional Extras\n\n```bash\nuv add \"lionagi[reader]\"    # Document reading (PDF, HTML, DOCX)\nuv add \"lionagi[mcp]\"       # MCP server support\nuv add \"lionagi[ollama]\"    # Local models via Ollama\nuv add \"lionagi[rich]\"      # Rich terminal output\nuv add \"lionagi[graph]\"     # Flow visualization\nuv add \"lionagi[postgres]\"  # PostgreSQL persistence\nuv add \"lionagi[all]\"       # Everything\n```\n\n## Community\n\n- [Discord](https://discord.gg/JDj9ENhUE8) — questions, ideas, help\n- [Issues](https://github.com/khive-ai/lionagi/issues) — bugs and feature requests\n- [Contributing](docs/contributing.md) — PR workflow\n\n**Citation**\n\n```bibtex\n@software{Li_LionAGI_2023,\n  author = {Haiyang Li},\n  year   = {2023},\n  title  = {LionAGI: Towards Automated General Intelligence},\n  url    = {https://github.com/khive-ai/lionagi},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhive-ai%2Flionagi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhive-ai%2Flionagi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhive-ai%2Flionagi/lists"}