Skip to main content

A framework for creating AI agents and agent managers

Project description

Agentic

A simple framework for creating AI agents and agent managers with LLM backends.

Installation

pip install agentrix

Usage

from agentrix import Tool, Agent, ManagerAgent
import openai

# Initialize OpenAI client
client = AzureOpenAI(
    api_key=os.getenv('AZURE_OPENAI_API_KEY'),
    api_version="2024-02-15-preview",
    azure_endpoint=os.getenv('AZURE_OPENAI_ENDPOINT')
)

# Create a simple tool
calculator_tool = Tool(
    name="calculator",
    description="Calculate a mathematical expression",
    function=lambda expression: eval(expression),
    inputs={"expression": ["string", "The math expression to evaluate"]}
)

# Create an agent with the tool
math_agent = Agent(
    name="MathAgent",
    system_prompt="You are a helpful mathematical assistant.",
    llm=client,
    tools=[calculator_tool],
    verbose=True
)

# Use the agent
result = math_agent.go("What is 25 squared plus 13?")
print(result)

Creating a Manager Agent

# Create specialized agents
researcher = Agent("Researcher", "You research facts thoroughly.", client)
analyst = Agent("Analyst", "You analyze data and provide insights.", client)

# Create a manager agent
manager = ManagerAgent(
    name="Manager",
    system_prompt="You coordinate multiple agents to solve complex problems.",
    llm=client,
    agents=[(researcher, "Use for researching facts"), (analyst, "Use for data analysis")],
    parallel=True,
    verbose=True
)

# Use the manager agent
result = manager.go("Research the population of France and analyze its growth trend.")
print(result)

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

agentrix-0.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

agentrix-0.0.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file agentrix-0.0.2.tar.gz.

File metadata

  • Download URL: agentrix-0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for agentrix-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0b39cfc5901253c211e79f8591d569aea6ac3611b0b91253afc143b078c8b2ad
MD5 dfc968fb718503098860a86217eb365b
BLAKE2b-256 243fbfdedbace8cd06d9a3f7277c5c722bad566264d6197b8579474a4b85f243

See more details on using hashes here.

File details

Details for the file agentrix-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: agentrix-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for agentrix-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 87ef76d8c78b537f1b595256b3e5cbdd72df706a5839b7216ff7f88b98179291
MD5 a55790e6b2b9442c7ddf630d97953c75
BLAKE2b-256 cdaca7da45637500303828dcf8b2c57094b91faa851730446c0d025f79d33dd5

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