Metadata-Version: 2.4
Name: infiagent
Version: 3.12.24
Summary: InfiAgent multi-agent framework for long-running task automation
Home-page: https://github.com/ChenglinPoly/Multi-Level-Agent
Author: Chenglin Yu
Author-email: yuchenglin96@qq.com
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: litellm==1.82.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: tiktoken>=0.5.0
Requires-Dist: virtualenv>=20.0.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: chardet>=5.2.0
Requires-Dist: mcp; python_version >= "3.10"
Requires-Dist: pdfplumber>=0.10.0
Requires-Dist: python-docx>=1.1.0
Requires-Dist: crawl4ai>=0.3.0
Requires-Dist: ddgs>=1.0.0
Requires-Dist: arxiv>=2.0.0
Requires-Dist: prompt_toolkit>=3.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: PyMuPDF
Requires-Dist: playwright>=1.40.0
Requires-Dist: docx2pdf
Requires-Dist: litellm==1.82.6
Requires-Dist: python-pptx>=0.6.21
Requires-Dist: crawl4ai>=0.3.0
Requires-Dist: ddgs>=1.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: arxiv>=2.0.0
Requires-Dist: prompt_toolkit>=3.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: psutil>=5.9.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# InfiAgent

InfiAgent is a long-horizon multi-agent framework built around three ideas:
**configuration-defined agents** (an agent is YAML, not a class), a **forgetting
loop** (short action windows + periodic thinking summaries + file relay), and a
**resumable execution stack** (all conversation/stack/action state is persisted
under a portable `user_root/`, so tasks survive interruption and resume across
processes and machines).

```bash
pip install infiagent
```

This package ships the complete backend runtime: the agent execution loop,
context builder, tool executor, the built-in level-0 tool suite, the LLM
client with multi-provider deployment failover, the concurrency-safe
experience store, and the SDK entry point, together with the full test suite.

## Quick start

```python
from infiagent import infiagent

agent = infiagent(
    user_data_root="./user_root",
    agent_library_dir="./user_root",
    default_agent_system="my_system",
    default_agent_name="alpha_agent",
    direct_tools=True,
)
result = agent.run("your task", task_id="./user_root/tasks/demo")
```

Agent systems are defined under `user_root/agent_library/<system>/`
(`level_3_agents.yaml`, `level_0_tools.yaml`, `general_prompts.yaml`);
model access is configured in `user_root/config/llm_config.yaml`
(single key, or a multi-provider `deployments` list with sticky-primary
failover). Task state persists under `user_root/tasks/<task_id>/` and
`user_root/conversations/`, and interrupted tasks can be resumed.

## Reliability characteristics

- **Crash-safe persistence:** runtime state is written atomically
  (same-directory temp file + fsync + rename); corrupted legacy state files
  are quarantined automatically with a clean recovery path, and interrupted
  tool calls replay idempotently on resume.
- **Concurrency-safe experience store:** cross-process file locks over the
  full read-modify-write, uuid entry ids, file revisions with optimistic
  concurrency checks, transactional dual-scope writes, and only
  `status=active` entries are injected into agent context.
- **Multi-provider LLM failover:** a model may declare multiple deployments
  (keys/platforms); healthy traffic sticks to the primary to preserve
  provider-side prompt caching, failures cool down and fail over
  automatically.

## License

GPL-3.0. See `LICENSE`.
