ArcheAI is a lightweight Python framework that simplifies AI agent development. Build smarter, more capable agents with ease using ArcheAI's easy tool integration, LLM interaction, and agent orchestration.
Project description
Welcome to ArcheAI! 🚀
Building AI agents should feel like assembling a dream team, not wrestling with complex code.
🌟 Why ArcheAI?
ArcheAI is a lightweight Python framework designed to make AI agent development intuitive, flexible, and downright fun! 🎉
"Another AI agent framework? What makes ArcheAI different?" 🤔
Let's break it down:
- Simplicity First 🧘
- Strip away unnecessary complexity
- Clean and elegant API
- Unleash Your Creativity 🎨
- Modular design for experimentation
- Support for various LLMs (Gemini, Groq, Cohere, OpenAI, Anthropic)
- Power in Collaboration 🤝
- TaskForce feature for seamless agent orchestration
- Built for Exploration 🔭
- Flexible foundation ready to adapt to new technologies
⚙️ Installation
Get started with ArcheAI in just one line:
pip install archeai
📚 Core Concepts
👤 The Agent Class
The Agent class is the heart of ArcheAI. It represents an individual AI agent within your system.
Key Attributes
Attribute | Description |
---|---|
llm |
An instance of the LLM (Large Language Model) class that the agent will use for language processing and decision-making. |
tools |
A list of Tool objects that define the actions the agent can perform. |
identity |
A string representing the agent's name or identifier. |
description |
A brief description of the agent's role or purpose. |
expected_output |
A string describing the expected format or style of the agent's responses. |
objective |
The current task or goal that the agent is trying to achieve. |
memory |
A boolean value indicating whether the agent should use memory (to retain context from previous interactions). Defaults to True . |
ask_user |
A boolean value indicating whether the agent should ask the user for input when generating responses. Defaults to True . |
memory_dir |
The directory where the agent's memory files will be stored. Defaults to memories . |
max_chat_responses |
The maximum number of previous conversation turns to store in memory. Defaults to 12 . |
max_summary_entries |
The maximum number of summary entries to store in memory. Defaults to 3 . |
max_iterations |
The maximum number of iterations the agent will attempt to generate a valid response. Defaults to 3 . |
check_response_validity |
A boolean value indicating whether the agent should check the validity of the response before it is returned. Defaults to False . |
allow_full_delegation |
Whether the agent should allow full delegation switching to True would give all the previous responses from different agents. Switching to False would only allow the last response, Defaults to False |
output_file |
The name of the file where the agent's responses will be saved. Defaults to None . |
verbose |
A boolean value indicating whether the agent should print verbose output during execution. Defaults to False . |
Methods
add_tool(tool)
: Add a new tool to the agentremove_tool(tool_name)
: Remove a tool by namerollout()
: Execute the agent's main workflow
🧰 The Tool Class
Tools are actions or capabilities that an agent can perform.
from archeai import Tool
def get_weather(city: str):
"""Fetches the current weather for a given city."""
# Implementation...
return weather_data
weather_tool = Tool(
func=get_weather,
description="Gets the current weather for a specified city.",
params={'city': {'description': 'The city to check weather for', 'type': 'str', 'default': 'unknown'}}
)
Key Attributes
Attribute | Description |
---|---|
func |
The Python function that defines the tool's action. |
name |
The name of the tool (automatically derived from the function name). |
description |
A brief description of what the tool does. This is used by the agent to understand the tool's purpose. |
returns_value |
A boolean indicating whether the tool returns a value that can be used by other tools or included in the response. Defaults to True . |
instance |
Optional instance of a class if the tool is a bound method. |
llm |
Optional LLM object for more advanced tool interactions (e.g., using the LLM to help determine tool parameters). |
verbose |
A boolean indicating whether the tool should print verbose output during execution. Defaults to False . |
params |
An Optional dictionary containing information about the tool's parameters (automatically extracted if not provided). |
👥 The TaskForce Class
Manage a group of Agent objects for collaboration and complex workflows.
Key Attributes
agents
: List of Agent objects in the task forceobjective
: Overall goal or task for the task forcemindmap
: Overall plan or mind map (auto-generated if not provided)
Key Methods
rollout()
: Starts the task force's execution
Workflow Diagram
🧑🤝🧑 Basic Example: Building Your First Team
from archeai import Agent, Tool, TaskForce
from archeai.llms import Gemini
# Initialize your LLM
llm = Gemini()
# Define tools
def say_hello(name: str):
return f"Hello there, {name}! 👋"
def calculate(equation: str):
return eval(equation)
hello_tool = Tool(func=say_hello,
description="Greets the user by name.",
params={'name': {'description': 'The name to greet.', 'type': 'str', 'default': 'unknown'}})
calculate_tool = Tool(func=calculate,
description="Evaluates an equation.",
params={'equation': {'description': 'The equation to evaluate.', 'type': 'str', 'default': 'unknown'}})
# Create agents
greeter = Agent(llm=llm,
tools=[hello_tool],
identity="Friendly Greeter",
memory=False,
verbose=True)
math_magician = Agent(llm=llm,
tools=[calculate_tool],
identity="Math Magician",
memory=False,
verbose=True)
# Assemble your task force!
my_taskforce = TaskForce(agents=[greeter, math_magician],
objective="Hi I am Mervin greet me, can you solve 3-4*2*5/4/2.1*6 for me and give a explanation.")
# Start the interaction
response = my_taskforce.rollout()
print(response)
This example demonstrates creating agents with tools and using a TaskForce to manage execution.
🧐 Important Questions
What is MindMap?
A mind map is a visual representation of the task force's workflow and goals. It's automatically generated if not provided, helping to organize and structure the collaboration between agents.
What does allow_full_delegation mean?
The allow_full_delegation
parameter controls how much information is shared between agents:
- When
False
(default): Only the last response is shared - When
True
: All previous responses from different agents are shared
This allows for more comprehensive or limited collaboration depending on your needs.
🚀 Advanced Features
- Multi-LLM Support: Seamlessly switch between different language models
- Custom Tool Creation: Easily create and integrate your own tools
- Memory Management: Fine-tune agent memory for context retention
- Response Validation: Ensure output quality with built-in validation
📈 Performance and Scalability
ArcheAI is designed for efficiency:
- Lightweight core for minimal overhead
- Asynchronous capabilities for improved performance
- Scalable architecture for complex agent networks
🤝 Contributing
We welcome contributions! Please feel free to:
Open an issue Submit a pull request
Check out our Contribution Guidelines for more information.
📄 License
This project is licensed under the MIT License.
⭐ Don't Forget to Star!
If you find ArcheAI helpful, please give us a star on GitHub!
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
Built Distribution
File details
Details for the file archeai-0.0.4.tar.gz
.
File metadata
- Download URL: archeai-0.0.4.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8f2861f9564b8c3a95c78194849139a29eba85f91e310f27bb353ff2e7d124a |
|
MD5 | 01b1c78142eaba240b122d526a711f7d |
|
BLAKE2b-256 | d9c9a903f726584d7d16052b9c581a85a2e46119a84026bf45406a72992c4abf |
File details
Details for the file archeai-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: archeai-0.0.4-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b1ddc65df84de7587bf9c7d98ef7cdb11987ab0f8ee003481f15f5b26dfaa4f |
|
MD5 | a5d6dcb379d168dc911c81a4da0a373c |
|
BLAKE2b-256 | d2ce483a8112ad5cf325fb7a94dd29e9d98e4cdbc3e2b9f28b5e245b18c76663 |