lion-agi / lionagi

An AGentic Intelligence Operating System
https://lionagi.ai
Apache License 2.0
293 stars 55 forks source link
agents ai automation data llm machine-learning workflow

PyPI - Version PyPI - Downloads Dependencies Python Version

Documentation | Discord | PyPI | Roadmap

LION Framework

Language InterOperable Network - The Future of Controlled AI Operations

Harness the power of next-generation AI while maintaining complete control and reliability.

Why LION?

The AI revolution is transforming how we work - but with great power comes great responsibility. LION provides the control mechanisms and reliability features needed to safely integrate advanced AI capabilities into enterprise workflows.

LION is designed to be:

Quick Start

from lionagi import Branch, iModel

# Initialize model
gpt4o = iModel(provider="openai", model="gpt-4o")

# Create a branch with personality
comedian = Branch(
    system="you are a sarcastic dragon hunter",
    imodel=gpt4o
)

# Chat asynchronously
response = await comedian.chat(
    "tell me a joke on knight vs dragon"
)

Installation

LION maintains minimal dependencies for maximum reliability:

pip install lionagi

Dependencies:

🌟 Example Workflow

Below is an example of what you can build with LION. Note that these are sample implementations - LION provides the building blocks, you create the workflows that fit your needs.

sequenceDiagram
    autonumber
    participant Client
    participant Orchestrator
    participant ResearchAgent
    participant AnalysisAgent
    participant ValidationAgent
    participant Tools

    Client->>+Orchestrator: Submit Complex Task
    Note over Orchestrator: Task Analysis & Planning

    %% Research Phase
    Orchestrator->>+ResearchAgent: Delegate Research
    activate ResearchAgent
    ResearchAgent->>Tools: Access Data Sources
    Tools-->>ResearchAgent: Raw Data
    ResearchAgent-->>-Orchestrator: Research Results
    deactivate ResearchAgent

    %% Analysis Phase
    Orchestrator->>+AnalysisAgent: Process Data
    activate AnalysisAgent
    AnalysisAgent->>Tools: Apply Models
    Tools-->>AnalysisAgent: Analysis Results
    AnalysisAgent-->>-Orchestrator: Processed Insights
    deactivate AnalysisAgent

    %% Validation Phase
    Orchestrator->>+ValidationAgent: Verify Results
    activate ValidationAgent
    ValidationAgent->>Tools: Apply Safety Checks
    Tools-->>ValidationAgent: Validation Status
    ValidationAgent-->>-Orchestrator: Verified Results
    deactivate ValidationAgent

    Orchestrator-->>-Client: Return Validated Output

🏗️ System Architecture

Here's how you can structure your LION-powered system. Each component can be customized to your specific needs.

graph TB
    subgraph Client Layer
        CL[Client Application]
    end

    subgraph Orchestration Layer
        ORC[Orchestrator]
        SEC[Security Controls]
        MON[Monitoring]
    end

    subgraph Agent Layer
        subgraph Specialized Agents
            RA[Research Agent]
            AA[Analysis Agent]
            VA[Validation Agent]
        end

        subgraph Agent Controls
            AC[Access Control]
            AM[Action Monitor]
            VE[Verification]
        end
    end

    subgraph Resource Layer
        subgraph Tool Management
            TM[Tool Registry]
            TP[Tool Policies]
        end

        subgraph Data Sources
            DS[Data Access]
            DV[Data Validation]
        end
    end

    %% Connections
    CL --> ORC
    ORC --> RA & AA & VA
    RA & AA & VA --> AC
    AC --> TM
    TM --> DS

    %% Control Flow
    ORC --> SEC
    SEC --> MON
    MON --> AM
    AM --> VE
    VE --> TP
    TP --> DV

    classDef primary fill:#1e40af,stroke:#1e3a8a,color:#fff
    classDef secondary fill:#3b82f6,stroke:#2563eb,color:#fff
    classDef control fill:#7c3aed,stroke:#6d28d9,color:#fff

🛠️ Building Blocks

LION provides the essential components you need to build reliable AI workflows:

Each component is designed to be:

🎯 Key Use Cases

🔒 Built for Reliability

LION isn't just another framework - it's your partner in responsible AI adoption. Build enterprise-grade AI systems with:

🤝 Contributing

Join our Discord community to:

📚 Citation

@software{Li_LionAGI_2023,
  author = {Haiyang Li},
  month = {12},
  year = {2023},
  title = {LionAGI: Intelligent Integration Framework},
  url = {https://github.com/lion-agi/lionagi},
}