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"]

⚠️ Orchestrator Beta Notice:
The orchestrator component is in early beta and may not work fully out of the box.
You can hack together your own tools and configs to get it working for your needs,
but expect some rough edges and double-check everything.
Improvements are ongoing.


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.67.tar.gz (125.1 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.67-py3-none-any.whl (149.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tiny_agent_os-0.67.tar.gz
  • Upload date:
  • Size: 125.1 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.67.tar.gz
Algorithm Hash digest
SHA256 d7d505e502f9638035a5dbfd83354ebcdd027b2e04791d1074db2c540a448c97
MD5 48e717061453f964d91f4ee2118666b1
BLAKE2b-256 b131e37099888a734b013dabdae9262fa36793c2e92176a3973bea208e54e7e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tiny_agent_os-0.67-py3-none-any.whl
  • Upload date:
  • Size: 149.2 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.67-py3-none-any.whl
Algorithm Hash digest
SHA256 693d2495b360112f4983e04e8913cbabfb2a38af2d2c96627fcc519b7993b2c3
MD5 5fc14845a8f91fc410ebcf685c76759e
BLAKE2b-256 0b145c41ef7ebab0f5a5ecf63cc74f3bc28a54154ef85b343fa98dbe4b8e64e6

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