Skip to main content

AI Agent Framework

Project description

Shoebill AI - AI Agent Framework

License Python Version

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

shoebill_ai-0.0.102.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

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

shoebill_ai-0.0.102-py3-none-any.whl (149.1 kB view details)

Uploaded Python 3

File details

Details for the file shoebill_ai-0.0.102.tar.gz.

File metadata

  • Download URL: shoebill_ai-0.0.102.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for shoebill_ai-0.0.102.tar.gz
Algorithm Hash digest
SHA256 a57bdd61a0e315d27a0587af078b16bc9475815d261d86769b7f123a86cd8494
MD5 ed3ce45d87cb8b18917ce12af0d2dcaf
BLAKE2b-256 17c3128098c82811f6edd7acc2f8c56c7d11af9c8340f55d38b3e039be728c82

See more details on using hashes here.

File details

Details for the file shoebill_ai-0.0.102-py3-none-any.whl.

File metadata

  • Download URL: shoebill_ai-0.0.102-py3-none-any.whl
  • Upload date:
  • Size: 149.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for shoebill_ai-0.0.102-py3-none-any.whl
Algorithm Hash digest
SHA256 174449250758df557f7c62ee1ea306afeabfe6e8e44ac2d043431b78c5ba7fc7
MD5 15514e20e769e2139078e50e1005965b
BLAKE2b-256 c04579a71581b729c878e3bfedc552dafb8a6e73d22e269419a85a3b8a05e3a7

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