Skip to main content

A workflow orchestration framework for LLM applications

Project description

ReasonFlow

A powerful workflow orchestration framework for LLM applications with built-in RAG support, agent management, and multi-modal processing capabilities.

Features

Core Components

  • Workflow Orchestration

    • DAG-based workflow execution
    • Dynamic task scheduling with priority management
    • State persistence and versioning
    • Real-time status tracking
    • Error handling and retry mechanisms
  • Agent System

    • Multiple LLM providers (OpenAI, Groq, Ollama, Anthropic)
    • RAG integration with vector databases
    • Custom task execution
    • API connector agents
    • Dynamic agent creation and configuration
  • Document Management

    • PDF processing and text extraction
    • Vector database integration (FAISS)
    • Document versioning
    • Full-text search capabilities
    • Multiple storage backends (S3, MinIO)

Integrations

  • LLM Providers

    • OpenAI (gpt-4o, gpt-4o-mini)
    • Groq (gemma, llama)
    • Ollama (local models)
    • Anthropic (claude)
    • ReasonChain
  • Vector Databases

    • FAISS (CPU/GPU)
    • Pinecone
    • Milvus
    • Qdrant
    • Weaviate
  • Storage Solutions

    • Firebase
    • AWS S3
    • MinIO
    • Local storage

Installation

Basic Installation (CPU)

pip install reasonflow

GPU Support (Recommended for large-scale deployments)

# Create conda environment
conda create -n reasonflow python=3.10
conda activate reasonflow

# Install FAISS GPU
conda install -c conda-forge faiss-gpu

# Install ReasonFlow
pip install reasonflow

Development Installation

git clone https://github.com/yourusername/reasonflow.git
cd reasonflow
pip install -e ".[dev]"

Quick Start

1. Configure Environment

Create a .env file:

OPENAI_API_KEY=your_openai_key
GROQ_API_KEY=your_groq_key
VECTOR_DB_PATH=vector_dbs/

2. Create a Simple Workflow

from reasonflow.orchestrator.workflow_builder import WorkflowBuilder
from reasonflow.integrations.llm_integrations import LLMIntegration
import os

# Initialize components
workflow_builder = WorkflowBuilder()

# Create LLM agent
llm = LLMIntegration(
    provider="openai",
    model="gpt-4o",
    api_key=os.getenv("OPENAI_API_KEY")
)

# Define workflow
workflow_config = {
    "tasks": {
        "analyze": {
            "type": "llm",
            "config": {
                "agent": llm,
                "params": {"prompt": "Analyze this text"}
            }
        }
    }
}

# Create and execute workflow
workflow_id = workflow_builder.create_workflow(workflow_config)
results = workflow_builder.execute_workflow(workflow_id)

3. RAG Integration Example

from reasonflow.integrations.rag_integrations import RAGIntegration

# Initialize RAG
rag = RAGIntegration(
    db_path="my_vectors.index",
    db_type="faiss",
    embedding_model="all-MiniLM-L6-v2"
)

# Add documents
rag.add_documents("document.pdf")

# Search
results = rag.search("What is the revenue growth?", top_k=5)

Project Structure

reasonflow/
├── agents/                 # Agent implementations
├── config/                 # Configuration files
├── integrations/          # External service integrations
├── orchestrator/          # Workflow management
├── persistence/           # State and data persistence
├── sdk/                   # Python and JavaScript SDKs
└── tasks/                 # Task management

Development

Running Tests

pytest tests/

Building Package

python build.py

Code Style

black reasonflow/
isort reasonflow/
flake8 reasonflow/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE for details.

Support

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

reasonflow-0.1.0.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

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

reasonflow-0.1.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file reasonflow-0.1.0.tar.gz.

File metadata

  • Download URL: reasonflow-0.1.0.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for reasonflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f559a1387bdf7ffe728ea0a14f34644898b83d508798e2e8ba8affbe1edbb34e
MD5 e4321e428c12d14224666d191255ceac
BLAKE2b-256 d4bdcadd59c8a34308d365a981b05032d341611922a8d226d3761fe1b31f31fe

See more details on using hashes here.

File details

Details for the file reasonflow-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: reasonflow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for reasonflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3f58c565ae249de3a40e593c66e1d32e3762c2d932a470002fb4540bf5cdd0c
MD5 b49bd5915239cf30958ffe00a3b24534
BLAKE2b-256 6cd687a797323162f23cb5bc67c41d1e37cc04c5635bb1474e8696d118446669

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