Skip to main content

A framework for creating AI agents, agent managers and Memory stores(buffer memory and Redis memory store).

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentrix-0.0.3.tar.gz
  • Upload date:
  • Size: 7.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.3.tar.gz
Algorithm Hash digest
SHA256 aef35fa4d8b881e89cbb3a92f7f266e307a4319227129d13f59cb65c59fb64e4
MD5 40965e73c6dbff2be90a709e2a9035fa
BLAKE2b-256 ba0480e940da79d6bc4c9f7ed2b40d476f498f90f7d09106c549d8460221fd18

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentrix-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4551b5a9ff810093132e7676ac333603dac258b90b244ea2e3f6c4dea20794
MD5 c643eebcb32e4b833960eea7558eeb5f
BLAKE2b-256 833e7f003bf80f1f1797d79c38ab6fa4db13aa2ac8847a30040992ea05eb5e9d

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