Skip to main content

Python SDK for Fibonacci Workflow Automation Platform

Project description

Fibonacci SDK

Build and deploy AI-powered workflows programmatically

PyPI version Python versions License

DocumentationInstallationQuick StartFeaturesIssues


What is Fibonacci?

Fibonacci is a platform for building autonomous AI agents and workflows. The SDK allows developers to:

  • 🤖 Build AI Workflows - Chain LLM calls, tools, and logic programmatically
  • 🚀 Deploy Instantly - One command to deploy to production
  • 🔧 40+ Integrations - Connect to Slack, Google Sheets, GitHub, and more
  • 📊 Monitor & Optimize - Track costs, performance, and optimize automatically

Installation

pip install fibonacci-sdk

With Security Features (Recommended)

pip install fibonacci-sdk[security]

This includes secure keychain storage for API keys.


Quick Start

1. Get Your API Key

Sign up at fibonacci.today to get your API key.

2. Set Up Authentication

# Option 1: Environment variable
export FIBONACCI_API_KEY="fib_live_your_api_key"

# Option 2: Secure keychain storage (recommended)
fibonacci security save
# Then enter your API key when prompted

3. Create Your First Workflow

from fibonacci import Workflow, LLMNode, ToolNode

# Create a workflow
wf = Workflow(
    name="Customer Support Bot",
    description="AI-powered customer support assistant"
)

# Add an LLM node
respond = LLMNode(
    id="respond",
    name="Generate Response",
    instruction="""
    You are a helpful customer support assistant.
    
    Customer message: {{input.message}}
    
    Provide a friendly, helpful response.
    """
)

wf.add_node(respond)

# Deploy to Fibonacci platform
workflow_id = wf.deploy()
print(f"Deployed! Workflow ID: {workflow_id}")

# Execute the workflow
result = wf.run(input_data={"message": "How do I reset my password?"})
print(result.output_data)

Features

🔗 Node Types

Node Description Example Use Case
LLMNode Call Claude AI models Text generation, analysis, summarization
ToolNode Execute platform tools Read Google Sheets, send Slack messages
CriticNode Evaluate outputs Quality scoring, validation
ConditionalNode Branch logic Route based on sentiment, conditions

📦 Example: Multi-Step Workflow

from fibonacci import Workflow, LLMNode, ToolNode, ConditionalNode

wf = Workflow(name="Sales Report Pipeline")

# Step 1: Read data from Google Sheets
read_data = ToolNode(
    id="read_data",
    name="Read Sales Data",
    tool="google_sheets_read",
    params={"spreadsheet_id": "{{input.sheet_id}}"}
)

# Step 2: Analyze with AI
analyze = LLMNode(
    id="analyze",
    name="Analyze Sales",
    instruction="Analyze this sales data and identify trends: {{read_data}}",
    dependencies=["read_data"]
)

# Step 3: Check if urgent
check_urgent = ConditionalNode(
    id="check_urgent",
    name="Check Urgency",
    left_value="{{analyze}}",
    operator="contains",
    right_value="urgent",
    true_branch=["send_alert"],
    false_branch=["send_report"],
    dependencies=["analyze"]
)

# Step 4a: Send alert if urgent
send_alert = ToolNode(
    id="send_alert",
    name="Send Urgent Alert",
    tool="slack_send_message",
    params={
        "channel": "#sales-alerts",
        "message": "🚨 URGENT: {{analyze}}"
    },
    dependencies=["check_urgent"]
)

# Step 4b: Send regular report
send_report = ToolNode(
    id="send_report",
    name="Send Report",
    tool="slack_send_message",
    params={
        "channel": "#sales-reports",
        "message": "📊 Daily Report: {{analyze}}"
    },
    dependencies=["check_urgent"]
)

wf.add_nodes([read_data, analyze, check_urgent, send_alert, send_report])

# Deploy and run
wf.deploy()
result = wf.run(input_data={"sheet_id": "abc123"})

💾 Memory & State

Persist data across workflow runs:

from fibonacci import Memory

# Store data
memory = Memory(scope="workflow", workflow_id="your-workflow-id")
memory.set("user_preferences", {"theme": "dark", "language": "en"})

# Retrieve later
prefs = memory.get("user_preferences")
print(prefs)  # {"theme": "dark", "language": "en"}

📄 YAML Support

Define workflows in YAML:

# workflow.yaml
name: Email Summarizer
description: Summarize incoming emails

nodes:
  - id: summarize
    type: llm
    name: Summarize Email
    instruction: "Summarize this email: {{input.email_body}}"
    config:
      model: claude-haiku-4-5
      max_tokens: 500
from fibonacci import Workflow

# Load from YAML
wf = Workflow.from_yaml("workflow.yaml")
wf.deploy()

# Export to YAML
wf.to_yaml("exported.yaml")

CLI Commands

# Initialize a new workflow project
fibonacci init "My Workflow"

# List your workflows
fibonacci list

# Execute a workflow
fibonacci run <workflow-id> '{"message": "hello"}'

# Check run status
fibonacci status <run-id>

# Security commands
fibonacci security status    # Check API key security
fibonacci security save      # Save API key to secure keychain
fibonacci security migrate   # Migrate from .env to keychain

# Audit logs
fibonacci audit view         # View recent audit events

Configuration

Environment Variables

Variable Description Default
FIBONACCI_API_KEY Your API key Required
FIBONACCI_BASE_URL API base URL http://api.fibonacci.today
FIBONACCI_TIMEOUT Request timeout (seconds) 300
FIBONACCI_DEBUG Enable debug logging false

Configuration File

Create ~/.fibonacci/config.yaml:

api_key: fib_live_your_key
base_url: http://api.fibonacci.today
timeout: 300
debug: false

Secure Storage (Recommended)

Store your API key in the system keychain:

fibonacci security save

This uses:

  • macOS: Keychain
  • Windows: Credential Manager
  • Linux: Secret Service

Tool Discovery

Find available tools programmatically:

from fibonacci import list_tools, get_tool_schema, search_tools

# List all tools
tools = list_tools()
for tool in tools:
    print(f"{tool['name']}: {tool['description']}")

# Get detailed schema
schema = get_tool_schema("google_sheets_read")
print(schema)

# Search for tools
results = search_tools("slack")
print(results)

Error Handling

from fibonacci import (
    Workflow,
    FibonacciError,
    AuthenticationError,
    ValidationError,
    ExecutionError
)

try:
    wf = Workflow(name="My Workflow")
    wf.deploy()
except AuthenticationError:
    print("Invalid API key")
except ValidationError as e:
    print(f"Workflow validation failed: {e.errors}")
except ExecutionError as e:
    print(f"Execution failed: {e.message}")
except FibonacciError as e:
    print(f"General error: {e.message}")

Requirements

  • Python 3.11 or higher
  • Valid Fibonacci API key

Dependencies

  • httpx - HTTP client
  • pydantic - Data validation
  • typer - CLI framework
  • rich - Terminal formatting
  • pyyaml - YAML support
  • keyring (optional) - Secure credential storage

Documentation


License

This SDK is proprietary software. See LICENSE for terms.

TL;DR: You can use this SDK with a valid Fibonacci API key. You cannot modify, redistribute, or create competing products.


Contributing

We welcome bug reports and feature suggestions! See CONTRIBUTING.md for guidelines.


Built with ❤️ by Fibonacci, Inc.

WebsiteDocs

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

fibonacci_sdk-0.2.2.tar.gz (60.0 kB view details)

Uploaded Source

Built Distribution

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

fibonacci_sdk-0.2.2-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

Details for the file fibonacci_sdk-0.2.2.tar.gz.

File metadata

  • Download URL: fibonacci_sdk-0.2.2.tar.gz
  • Upload date:
  • Size: 60.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fibonacci_sdk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 24b4c5e2b5252f7295366ab80fa7d651e4804109b7db63b982bda9658a070ce7
MD5 9b3c5b1d9aa411a120595cbbafe1960a
BLAKE2b-256 9b891daa6484c3c0e746ed4a034ad1b632b9bb787cfe5c75aa6c4eaa6adc6de8

See more details on using hashes here.

File details

Details for the file fibonacci_sdk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: fibonacci_sdk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 70.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fibonacci_sdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cd14c75528a5c8d1196a8b97fda7efad8ea2499b8e03c0aec061b426dc11e5ff
MD5 1280ec18f656f11ba72b501f8e7c53f8
BLAKE2b-256 ee52693c68b333e2df96c249da7c776816938fcf062304f74042c3a0d302c467

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