Skip to main content

A streamlined framework for building powerful LLM-powered agents that can solve complex tasks through tool execution, orchestration, and dynamic capability creation.

Project description

tinyAgent 🤖

License: Business Source License 1.1 (BSL)
Free for individuals and small businesses (<$1M annual revenue).
Commercial use by larger businesses requires an enterprise license.
Contact: admin@alchemiststudios.ai

A streamlined framework for building powerful LLM-powered agents that can solve complex tasks through tool execution, orchestration, and dynamic capability creation.

Made by (x) @tunahorse21 | A product of alchemiststudios.ai

Heads Up: tinyAgent is in BETA until V1. It's working but still evolving!
While I can't guarantee it's 100% bug-free, I'm actively improving it whenever I can between my day job and business. Found something that could be better? Show off your skills and open an issue with a fix: I'd genuinely appreciate it!

tinyAgent Logo

   __  .__                _____                         __
_/  |_|__| ____ ___.__. /  _  \    ____   ____   _____/  |_
\   __\  |/    <   |  |/  /_\  \  / ___\_/ __ \ /    \   __\
 |  | |  |   |  \___  /    |    \/ /_/  >  ___/|   |  \  |
 |__| |__|___|  / ____\____|__  /\___  / \___  >___|  /__|
              \/\/            \//_____/      \/     \/

Installation

# Install via pip (recommended)
pip install tiny_agent_os

# Or for development, clone the repository
git clone https://github.com/alchemiststudiosai/tinyAgent.git

cd tinyagent

# Option 1: For Linux users, run the installation script
chmod +x install/linuxInstall.sh && ./install/linuxInstall.sh

# Option 2: Manual installation
# Create a virtual environment (recommended)
python3 -m venv .venv

# Activate the virtual environment
# On macOS/Linux
source .venv/bin/activate
# On Windows
.\.venv\Scripts\activate

# Install dependencies
# Option 1: Using UV (recommended - see INSTALL.md for details)
# Option 2: Using pip
pip install -r requirements.txt

# Set up required configuration files
# 1. Environment variables
cp .envexample .env
# Edit .env to add your API keys (especially OpenRouter)

# 2. Configuration file
cp exampleconfig.yml config.yml
# Edit config.yml to customize your settings

Pip Installation

# Simple pip installation
pip install tiny_agent_os

Note: The orchestrator component is currently being built and is in beta.


Philosophy

  1. Functions as Agents
    • You can turn any function into a tool or agent.
    • This makes it easy to add new capabilities.
flowchart LR
    A["Python Function"] --> B["Tool"]
    B --> C["Agent"]
    C --> D["Result"]

Function to Agent Flow

# Define a simple calculator function and turn it into a tool
@tool
def calculate_sum(a: int, b: int) -> int:
    """Calculate the sum of two integers."""
    return a + b

def main():
    """Create a basic agent with a calculator tool."""
    # One-liner: create agent with our tool directly
    agent = AgentFactory.get_instance().create_agent(tools=[calculate_sum])
    # Run the agent with a query
    query = "calculate the sum of 5 and 3"
    print(f"Running agent with query: '{query}'")
    # you can also specify the expected type of the result
    result = agent.run(query, expected_type=int)
    print(f"Result: {result}")
    print(f"Result Type: {type(result)}")
  1. Hierarchical Orchestration
    • You can combine many agents together.
    • A top-level agent or orchestrator can delegate tasks to specialized agents.
    • This helps solve complex problems by breaking them into parts.
flowchart TD
    O["Research Orchestrator"] --> A1["Web Search Agent"]
    O --> A2["Summarizer Agent"]
    O --> A3["Code Snippet Agent"]

Features

  1. Modular Design

    • Tools are defined with @tool and easily integrated or swapped.
  2. Flexible Agent Options

    • Orchestrator: Simple task execution.
    • AgentFactory: Fine-tuned control.
    • DynamicAgentFactory: Dynamic agent creation.
  3. Centralized Setup

    • Factory pattern streamlines configuration and logging.
  4. Robust Error Handling

    • Custom exceptions (e.g., ToolError) improve debugging.
  5. Clean Code Structure

    • Agents handle logic; tools handle execution.
  6. Versatile Interaction

    • Use agent.execute_tool() for precision or agent.run() for broader tasks.
  7. Structured Output

    • Enforce JSON structure on LLM responses for consistent parsing
    • Enable with output.structured: true in config.yml
    • Compatible with OpenRouter's JSON schema validation

Acknowledgments & Inspo

We'd like to thank the creators of these amazing projects that inspired TinyAgent:


Key Takeaways

  • tinyAgent is perfect for scalable AI projects needing structured agent and tool management.
  • It offers extensibility, error handling, and logging, but may be overkill for simple tasks.

Important Note on Tools:

The aider tool integrated in TinyAgent is extremely powerful but requires proper understanding to use effectively. It's highly configurable with many advanced features that can dramatically enhance productivity when used correctly.

⚠️ We strongly recommend thoroughly learning aider before using it in any serious projects.

Invest time in studying the documentation at https://aider.chat/ to understand its capabilities, configuration options, and best practices. This investment will pay off significantly in your development workflow.

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

tiny_agent_os-0.66.tar.gz (116.4 kB view details)

Uploaded Source

Built Distribution

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

tiny_agent_os-0.66-py3-none-any.whl (136.9 kB view details)

Uploaded Python 3

File details

Details for the file tiny_agent_os-0.66.tar.gz.

File metadata

  • Download URL: tiny_agent_os-0.66.tar.gz
  • Upload date:
  • Size: 116.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tiny_agent_os-0.66.tar.gz
Algorithm Hash digest
SHA256 ed2aacb7ca7cd5d3d77d4796645a6a9ac8dad2008132fa65028c6c81999fb6db
MD5 7f5342f0a78e71da623d4c2cc2b5e268
BLAKE2b-256 c110bba0df9eda289269f142df3cac73169e26818e3b85fdbfe46b9f3f25b231

See more details on using hashes here.

File details

Details for the file tiny_agent_os-0.66-py3-none-any.whl.

File metadata

  • Download URL: tiny_agent_os-0.66-py3-none-any.whl
  • Upload date:
  • Size: 136.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tiny_agent_os-0.66-py3-none-any.whl
Algorithm Hash digest
SHA256 6e9d896e826653a4a19ef001b4ef636a06474a5361b0af10e7b136421c22cab0
MD5 9347e2397771c4fc3e800cc1217d5083
BLAKE2b-256 0f9095f504353137209113b39f36f1095ac3981d37c69b6be88dc0e540bb8f2f

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