Skip to main content

icogito

A modern Python CLI framework to build Agent/Multi-Agent systems on top of pydantic-ai, pydantic-ai-harness, OpenRouter, and Tavily tools.

icogito provides an end-to-end toolkit for scaffolding, configuring, and running production-grade AI agent and multi-agent architectures. It integrates durable execution via Prefect, modular tool registry integration (including Tavily search, fetch, and crawl tools), and OpenRouter model routing.


Key Features

  • CLI-Driven Scaffolding: Easily create standardized directory structures (agents/, configs/, prompts/, schemas/, tools/, utils/) using icogito init.
  • Interactive Configuration: Build single-agent and multi-agent workflow configurations interactively with icogito configure.
  • System Diagnostics: Verify tools, environment setup, and framework status with icogito doctor.
  • Agent Factory: Instantiates pydantic-ai Agents dynamically from YAML configurations (AgentConfig).
  • Durable Execution & Subagents: Supports task durability via PrefectDurability and hierarchical multi-agent delegation via SubAgents.
  • Built-in Web Tools: Tavily web integration for search, fetch, and crawl capabilities with built-in retry handling.

Get Started

Prerequisites

  • Python: Version >= 3.12
  • uv: Recommended fast Python package and environment manager (docs.astral.sh/uv)
  • API Keys:
    • OPENROUTER_API_KEY: Required for model inference via OpenRouter.
    • TAVILY_API_KEY: Required when using Tavily web tools (web_search, web_fetch, web_crawl).

Installation

Clone the repository and install dependencies using uv:

# Clone the repository
git clone https://github.com/danielrondon/icogito.git
cd icogito

# Sync project dependencies into .venv
uv sync

# (Optional) Sync test or prefect extra dependencies if developing, running tests, or using Prefect
uv sync --extra test
uv sync --extra prefect
# Or via pip:
# pip install "icogito[prefect]"

Local Environment Setup

Configure your environment variables before running agent workflows or tools:

export OPENROUTER_API_KEY="your-openrouter-api-key"
export TAVILY_API_KEY="your-tavily-api-key"

Usage

CLI Commands

The icogito CLI provides commands for project initialization, diagnostics, and agent configuration.

1. Initialize Project Scaffolding (icogito init)

Scaffold a standard agent directory structure in your project or a target directory:

# Initialize scaffolding in the current directory
uv run icogito init

# Or specify a target directory
uv run icogito init ./my_agent_project

This creates the following directory layout:

.
├── agents/
├── configs/
├── prompts/
├── schemas/
├── tools/
└── utils/

2. System Diagnostics (icogito doctor)

Check system environment status, global app directory path, available Tavily web tools, and AgentFactory readiness:

# Run standard diagnostic check
uv run icogito doctor

# Verbose diagnostic output
uv run icogito doctor --verbose

3. Interactive Agent Configuration (icogito configure)

Interactively configure single or multi-agent systems. This wizard prompts for agent names, OpenRouter models, providers, instructions, enabled tools, and subagents, then generates the corresponding YAML configs in configs/ and Markdown instructions in prompts/:

uv run icogito configure

Programmatic Usage

icogito provides high-level utilities and AgentFactory for loading configs and instantiating runtime agents.

Prefect Integration & Durable Execution

Prefect is an optional dependency. When importing Prefect modules in your code or agents (e.g., from prefect import flow, task), always use a try...except ImportError block:

try:
    from prefect import flow, task
    HAS_PREFECT = True
except ImportError:
    HAS_PREFECT = False

If you attempt to instantiate an agent with Prefect durability without prefect installed, icogito will instruct you to install the extra via pip install "icogito[prefect]".

Loading Configuration and Instantiating Agents

import os
from icogito.factory import AgentFactory
from icogito.utils.load_agent_config import load_agent_config

# Load agent configuration from YAML
config = load_agent_config("configs/research_agent_config.yaml")

# Initialize AgentFactory with your OpenRouter API Key
factory = AgentFactory(openrouter_api_key=os.getenv("OPENROUTER_API_KEY"))

# Create a pydantic-ai Agent instance
agent = factory.create_agent(config)

# Run the agent (async)
# result = await agent.run("Research recent developments in AI agent frameworks.")

Multi-Agent Setup with Subagents

When building a multi-agent system, subagent configurations are registered with AgentFactory:

from icogito.factory import AgentFactory
from icogito.utils.load_agent_config import load_agent_config

# Load root agent config and subagent configs
sub_config = load_agent_config("configs/sub_researcher_config.yaml")
root_config = load_agent_config("configs/root_manager_config.yaml")

# Register subagent configs map
subagent_configs = {
    sub_config.agent_name: sub_config
}

factory = AgentFactory(
    openrouter_api_key=os.getenv("OPENROUTER_API_KEY"),
    subagent_configs=subagent_configs
)

# Build the root agent (automatically wires subagents recursively)
root_agent = factory.create_agent(root_config)

Development & Testing

To run the full test suite using pytest:

uv run --extra test pytest

Authors

Metadata

Release files for icogito 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for icogito 0.2.0
File Size Uploaded Provenance Actions
icogito-0.2.0.tar.gz 10.6 kB Without provenance Details for icogito-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for icogito 0.2.0
File Interpreter ABI Platform Actions
icogito-0.2.0-py3-none-any.whl Python 3 none any Details for icogito-0.2.0-py3-none-any.whl

Total release size: 24.4 kB

Release files / icogito-0.2.0.tar.gz

Download URL icogito-0.2.0.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2706f19fad42849afde09392faed79aaddf662ac75446671ae346ba9daaa33bf
BLAKE2b-256 checksum
How to use checksums
3238fa21c1157e5977179089c19fc40cf9608bdb2249fa0b2d08ce73433f3b98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / icogito-0.2.0-py3-none-any.whl

Download URL icogito-0.2.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e5b4412f44111c937108b45ab2b6e96518ffafbc232f0f2cf30af3a24fe5834
BLAKE2b-256 checksum
How to use checksums
669e48bad5a255489187c8b12f6e529e53e4d061fdf8db26cb39c0dcde70d986
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for icogito 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page