Skip to main content

UnisonAI Multi-Agent Framework provides a flexible, light-weight experience and extensible environment for creating and coordinating multiple AI agents.

Project description

UnisonAI Banner

Table of Contents

UnisonAI

Orchestrate the Future of Multi-Agent AI

Stars

License

Python Version


Overview

UnisonAI is a lightweight Python framework for building single-agent and multi-agent AI systems.

  • Agent — standalone or part of a clan, with tool integration and conversation history.

  • Clan — coordinate multiple agents on a shared goal with built-in A2A messaging.

  • Tool System — create tools with @tool decorator or BaseTool class; type-validated, standardized results.

Supports Gemini, OpenAI, Anthropic, Cohere, Groq, Mixtral, xAI, Cerebras, and any custom model (extend BaseLLM).


Quick Start

pip install unisonai-sdk
from unisonai import Agent

from unisonai.llms import Gemini



agent = Agent(

    llm=Gemini(model="gemini-2.0-flash"),

    identity="Assistant",

    description="A helpful AI assistant",

)



print(agent.unleash(task="Explain quantum computing in 3 sentences"))

What Makes UnisonAI Special

Agent-to-Agent (A2A) communication — agents talk to each other as if they were teammates collaborating on complex tasks.

Example

Perfect For

  • Complex Research — multiple agents gathering, analyzing, and synthesizing information

  • Workflow Automation — coordinated agents handling multi-step processes

  • Content Creation — specialized agents for research, writing, and editing

  • Data Analysis — distributed agents processing data with different expertise


Core Components

| Component | Purpose | Key Features |

|-----------|---------|--------------|

| Agent | Standalone or clan member | Tool integration, history, inter-agent messaging |

| Clan | Multi-agent orchestration | Automatic planning, task distribution, A2A communication |

| Tool System | Extensible capabilities | @tool decorator, BaseTool class, type validation |


Usage Examples

Individual Agent

from unisonai import Agent

from unisonai.llms import Gemini



agent = Agent(

    llm=Gemini(model="gemini-2.0-flash"),

    identity="Research Assistant",

    description="An AI assistant for research tasks",

)



agent.unleash(task="Summarize the key benefits of renewable energy")

Agent with Tools

from unisonai import Agent

from unisonai.llms import Gemini

from unisonai.tools.tool import tool



@tool(name="calculator", description="Arithmetic on two numbers")

def calculator(operation: str, a: float, b: float) -> str:

    ops = {"add": a + b, "subtract": a - b, "multiply": a * b, "divide": a / b if b else "err"}

    return str(ops.get(operation, "unknown op"))



agent = Agent(

    llm=Gemini(model="gemini-2.0-flash"),

    identity="Math Helper",

    description="An assistant with a calculator tool",

    tools=[calculator()],

)



agent.unleash(task="What is 1500 * 32?")

Multi-Agent Clan

from unisonai import Agent, Clan

from unisonai.llms import Gemini



researcher = Agent(

    llm=Gemini(model="gemini-2.0-flash"),

    identity="Researcher",

    description="Gathers information on topics",

    task="Research assigned topics",

)



writer = Agent(

    llm=Gemini(model="gemini-2.0-flash"),

    identity="Writer",

    description="Writes clear reports from research",

    task="Write polished reports",

)



clan = Clan(

    clan_name="Research Team",

    manager=researcher,

    members=[researcher, writer],

    shared_instruction="Researcher gathers info, Writer produces the report.",

    goal="Write a brief report on AI in healthcare",

    output_file="report.txt",

)



clan.unleash()

Custom Tools

UnisonAI supports two ways to create tools:

1. Decorator-based (Recommended)

from unisonai.tools.tool import tool



@tool(name="calculator", description="Math operations")

def calculator(operation: str, a: float, b: float) -> str:

    if operation == "add":

        return str(a + b)

    elif operation == "multiply":

        return str(a * b)

    return "Unknown operation"

2. Class-based (For complex/stateful tools)

from unisonai.tools.tool import BaseTool, Field

from unisonai.tools.types import ToolParameterType



class Calculator(BaseTool):

    def __init__(self):

        self.name = "calculator"

        self.description = "Math operations"

        self.params = [

            Field(name="operation", description="add or multiply",

                  field_type=ToolParameterType.STRING, required=True),

            Field(name="a", description="First number",

                  field_type=ToolParameterType.FLOAT, required=True),

            Field(name="b", description="Second number",

                  field_type=ToolParameterType.FLOAT, required=True),

        ]

        super().__init__()



    def _run(self, operation: str, a: float, b: float) -> float:

        return a + b if operation == "add" else a * b

API Key Configuration

  1. Environment Variables:

    export GEMINI_API_KEY="your-key"
    
    export OPENAI_API_KEY="your-key"
    
  2. Direct Initialization:

    llm = Gemini(api_key="your-key")
    

Documentation Hub

Getting Started

Core Documentation

Advanced Features

Examples


FAQ

What is UnisonAI?

Python framework for building and orchestrating AI agents with A2A communication.

When should I use a Clan?

For complex, multi-step tasks requiring specialized agents working together.

Can I add custom LLMs?

Yes! Extend BaseLLM to integrate any model provider.

What are tools?

Reusable components that extend agent capabilities. Create them with the @tool decorator or the BaseTool class.

How do I manage API keys?

Use environment variables or pass directly to the LLM constructor.


Contributing

Author: Anant Sharma (E5Anant)

PRs and issues welcome!

Open Issues

Submit PRs

Suggest Features


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

unisonai_sdk-1.3.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

unisonai_sdk-1.3-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file unisonai_sdk-1.3.tar.gz.

File metadata

  • Download URL: unisonai_sdk-1.3.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for unisonai_sdk-1.3.tar.gz
Algorithm Hash digest
SHA256 403f7045ba74f4b5eb64e7810c405c74b7bfb049cdd45be9be7b18e22b812bdb
MD5 17039653a953af8044f77164fb1899fc
BLAKE2b-256 0757a76464905b27926e9fac48998cb853a45bdc8f3809594eb11960f5127f36

See more details on using hashes here.

File details

Details for the file unisonai_sdk-1.3-py3-none-any.whl.

File metadata

  • Download URL: unisonai_sdk-1.3-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for unisonai_sdk-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72209d945b1bc3822e99b32e69021ccb95ef0faeec371e2c602c24db98ef830b
MD5 3ca8343766384cb1487cf58d7e59e76e
BLAKE2b-256 6bdfad38b9107c4e141f93ab9116eeff8d4decf6262aeb346b6a95d902d8fe73

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