Skip to main content

A simple multi-agent framework

Project description

iragent

iragent – a simple multi‑agent framework

PyPI Python License CI

iragent is a simple framework for building OpenAI‑Like, tool‑using software agents.
It sits halfway between a prompt‑engineering playground and a full orchestration layer—perfect for experiments, research helpers and production micro‑agents.


✨ Key features

Feature Why it matters
Composable Agent model Chain or orchestrate agents via SimpleSequentialAgents, AgentManager, and AutoAgentManager for flexible workflows
Auto-routing agent AutoAgentManager uses a language model to dynamically decide the next agent in the loop
Web-augmented agent InternetAgent uses googlesearch, requests, and summarizing agents to fetch and condense live web data
Parallel summarization fast_start method uses ThreadPoolExecutor to speed up web content processing
Prompt-driven summaries Summarization is driven by customizable system prompts and token-limited chunking for accurate context
Simple, Pythonic design Agents are lightweight Python classes with callable message interfaces—no metaclasses or hidden magic
Memory, BaseMemory BaseMemory provides foundational memory management for agents, storing conversation history and message objects. It supports adding, retrieving, and clearing memory, offering a flexible design for session-based context, interaction history, or task-specific memory across multiple agent invocations. Ideal for scenarios where the agent needs to recall past interactions for continuity.

🚀 Installation

# Requires Python 3.10+
pip install iragent
# Or directly from GitHub
pip install git+https://github.com/parssky/iragent.git

⚡ Quick start

from iragent.tools import get_time_now, simple_termination

factory = AgentFactory(base_url,api_key, model, provider)

agent1 = factory.create_agent(name="time_reader",
                            system_prompt="You are that one who can read time. there is a fucntion named get_time_now(), you can call it whether user ask about time or date.",
                            fn=[get_time_now]
                            )
agent2 = factory.create_agent(name="date_exctractor", 
                              system_prompt= "You are that one who extract time from date. only return time.")
agent3 = factory.create_agent(name="date_converter", 
                              system_prompt= "You are that one who write the time in Persian. when you wrote time, then in new line write [#finish#]")

manager = AutoAgentManager(
    init_message="what time is it?",
    agents= [agent1,agent2,agent3],
    first_agent=agent1,
    max_round=5,
    termination_fn=simple_termination,
    termination_word="[#finish#]"
)

res = manager.start()
res.content

More docs

visit below url: https://parssky.github.io/iragent/namespacemembers.html

📚 More Usage Examples

Explore practical examples and use cases in the example directory.

Development

git clone https://github.com/parssky/iragent.git
cd iragent
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"          # ruff, pytest, etc.

🤝 Contributing

Pull requests are welcome! Please open an issue first if you plan large‑scale changes. 1- Fork → create feature branch

2- Write tests & follow ruff style (ruff check . --fix)

3- Submit PR; GitHub Actions will run lint & tests.

📄 License

This project is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iragent-0.1.3.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iragent-0.1.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file iragent-0.1.3.tar.gz.

File metadata

  • Download URL: iragent-0.1.3.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for iragent-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bfc4a102b1747db69bed728e46c15e72dc654960e283f101cc987e2c3e40d8ec
MD5 af2087ccc2435ffda63316b5381a4b8b
BLAKE2b-256 333a2dc7cfbf8edd50856c3e66b3193877076946b1839986d1497dbd03fe5d72

See more details on using hashes here.

File details

Details for the file iragent-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: iragent-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for iragent-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e28ab35eed3da7b9ececc0720a0498ca2f6a7113403df20183b23703b984903
MD5 015a610c9ac2dc8328444ec7fa2ffecd
BLAKE2b-256 d6e89993eb8d9f81f9eebbe7219f21e0666387d0dc9e38e9b7eb869d391731f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page