AI Agent Framework
Project description
Shoebill AI - AI Agent Framework
Shoebill AI is a powerful framework for creating, orchestrating, and executing workflows with AI agents. It provides a flexible and extensible architecture for building complex AI applications by connecting multiple agents and functions together.
🚀 Features
- Agent Management: Create and manage different types of AI agents (text, vision, multimodal, embedding)
- Workflow Orchestration: Build complex workflows by connecting agents and functions
- Function Integration: Incorporate custom Python functions into your workflows
- Workflow Scheduling: Schedule workflows to run at specific times using cron syntax
📦 Installation
pip install shoebill_ai
🔧 Requirements
- Python 3.10 or higher
- Dependencies:
- requests~=2.32.3
- pillow~=11.2.1
- ollama~=0.5.0
- h_message_bus~=0.0.41
🏁 Quick Start
from shoebill_ai.application.workflows.agent_orchestrator import AgentOrchestrator
# Initialize the orchestrator
orchestrator = AgentOrchestrator(
api_url="YOUR_API_URL",
api_token="YOUR_API_TOKEN"
)
# Create a text agent
text_agent = orchestrator.create_text_agent(
name="Simple Assistant",
description="A helpful assistant that answers user queries",
model_name="gpt-4",
system_prompt="You are a helpful assistant that provides concise and accurate information."
)
# Create a workflow
workflow = orchestrator.create_workflow(
name="Simple Query Workflow",
description="A workflow that processes user queries and returns responses"
)
# Add nodes to the workflow
input_node = orchestrator.add_input_node(
workflow_id=workflow.id,
name="User Query Input"
)
agent_node = orchestrator.add_agent_node(
workflow_id=workflow.id,
name="Text Assistant",
agent_id=text_agent.id
)
output_node = orchestrator.add_output_node(
workflow_id=workflow.id,
name="Assistant Response",
output_key="response"
)
# Connect the nodes with edges
orchestrator.add_edge(
workflow_id=workflow.id,
source_node_id=input_node.id,
target_node_id=agent_node.id,
source_output="text",
target_input="message"
)
orchestrator.add_edge(
workflow_id=workflow.id,
source_node_id=agent_node.id,
target_node_id=output_node.id,
source_output="response",
target_input="result"
)
# Execute the workflow
result = orchestrator.execute_workflow(
workflow_id=workflow.id,
input_data={"text": "What is machine learning?"}
)
print(result)
📚 Documentation
Package Structure
The Shoebill AI package is organized into three main layers:
shoebill_ai/
├── application/ # Application layer - services and orchestration
├── domain/ # Domain layer - core business logic and entities
├── infrastructure/ # Infrastructure layer - external integrations and implementations
└── resources/ # Resources - configuration files and other assets
Application Layer
The application layer contains services that coordinate the use of domain entities to perform specific tasks or workflows. This layer acts as a bridge between the domain layer and the external world.
Agent Services
The agent services provide high-level APIs for creating and interacting with different types of AI agents:
- TextService: Service for creating and interacting with text-based agents
- VisionService: Service for creating and interacting with vision-based agents
- MultimodalService: Service for creating and interacting with multimodal agents (text + vision)
- EmbeddingService: Service for creating and interacting with embedding agents
Workflow Services
The workflow services provide APIs for creating, managing, and executing workflows:
- WorkflowService: Service for creating and managing workflows
- FunctionService: Service for registering and executing functions within workflows
- WorkflowQueueService: Service for batch processing of workflows
- WorkflowScheduler: Service for scheduling workflow executions using cron syntax
- AgentOrchestrator: Main entry point that combines agent and workflow services
Domain Layer
The domain layer contains the core business logic and entities of the framework. This includes the models, interfaces, and business rules that define what the system does, independent of how it's presented to the user or how it interacts with external systems.
Agent Models
The domain layer defines the core agent models that represent different types of AI agents:
- BaseAgent: Abstract base class for all agent types
- TextAgent: Agent that processes text inputs and produces text outputs
- VisionAgent: Agent that processes image inputs and produces text outputs
- MultimodalAgent: Agent that processes both text and image inputs
- EmbeddingAgent: Agent that generates vector embeddings from text
Workflow Models
The domain layer defines the core workflow models that represent workflows and their components:
- Workflow: Represents a complete workflow with nodes and edges
- WorkflowNode: Represents a node in a workflow (agent, function, input, output, etc.)
- WorkflowEdge: Represents a connection between nodes in a workflow
Messaging Models
The domain layer defines various message models for different types of communication:
- Flow Messages: Messages for controlling message flow
- Graph Messages: Messages related to graph operations
- Telegram Messages: Messages for Telegram integration
- Twitter Messages: Messages for Twitter integration
- Vector Messages: Messages for vector operations
- Web Messages: Messages for web integration
Infrastructure Layer
The infrastructure layer provides concrete implementations of interfaces defined in the domain layer. This layer is responsible for technical concerns such as external system integrations, data persistence, and other implementation details.
Agent Implementations
The infrastructure layer provides concrete implementations of agent interfaces:
- InMemoryAgentRegistry: In-memory implementation of IAgentRegistry
- OllamaAgentFactory: Factory for creating agents that use Ollama models
- OllamaTextAgent: Implementation of TextAgent using Ollama
- OllamaVisionAgent: Implementation of VisionAgent using Ollama
- OllamaMultimodalAgent: Implementation of MultimodalAgent using Ollama
- OllamaEmbeddingAgent: Implementation of EmbeddingAgent using Ollama
Workflow Implementations
The infrastructure layer provides concrete implementations of workflow interfaces:
- InMemoryWorkflowRepository: In-memory implementation of IWorkflowRepository
- InMemoryFunctionRegistry: In-memory implementation of IFunctionRegistry
- InMemoryWorkflowScheduleRepository: In-memory implementation of IWorkflowScheduleRepository
- AdvancedWorkflowExecutionEngine: Implementation of IWorkflowExecutionEngine that supports advanced workflow features
- WorkflowScheduler: Service for scheduling workflow executions using cron syntax
- CronParser: Utility for parsing and validating cron expressions
🧪 Examples
The examples directory contains sample code demonstrating various features of the framework:
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file shoebill_ai-0.0.105.tar.gz.
File metadata
- Download URL: shoebill_ai-0.0.105.tar.gz
- Upload date:
- Size: 64.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
984a90b16ef7b9fc41a9632244cf80fc168115a293bf810351ca8726746d41b6
|
|
| MD5 |
f6c2010dab84a8b7fb421d16dd43e698
|
|
| BLAKE2b-256 |
4db496b416ee729f8ca3afde8f8f1cddc11ba45278982ad5f1127830e7520382
|
File details
Details for the file shoebill_ai-0.0.105-py3-none-any.whl.
File metadata
- Download URL: shoebill_ai-0.0.105-py3-none-any.whl
- Upload date:
- Size: 149.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07f4e9f23a8f565dffead2f0aa7da242930db4ebf87618f7211294d66532d4c1
|
|
| MD5 |
c44d446ce855522e5b5a1645c278da6d
|
|
| BLAKE2b-256 |
801896e51738fc2134915a82c8223fcf37a3fccb78d91195830d60f3d0f2cca5
|