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

Uploaded Python 3

File details

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

File metadata

  • Download URL: shoebill_ai-0.0.110.tar.gz
  • Upload date:
  • Size: 64.5 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.110.tar.gz
Algorithm Hash digest
SHA256 31c5cb20f97d5cb775cac701d0fe2f9a05c9af53ed901c42a90874c9f0598297
MD5 c963439d27a8f4a22a2a62e17a88b2e1
BLAKE2b-256 19f3c3452b4a186592fc1dfab7354aa161e5e2480fef8c59f69405a0be401c24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shoebill_ai-0.0.110-py3-none-any.whl
  • Upload date:
  • Size: 149.5 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.110-py3-none-any.whl
Algorithm Hash digest
SHA256 613d895c6e73fa1e09a3517d740380f6e413baf836ef5fe92c9209b9a1c752db
MD5 95e5cafd73d217d45e84fc160aa9b558
BLAKE2b-256 5a032f2260681ccff698e79eabecda46193ea5319b35c759b3e09e2707dd04d3

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