π Welcome to Flock! Take Flight with Declarative AI Agents π¶
Tired of wrestling with paragraphs of prompt text just to get your AI agent to do one specific thing? π« Enter Flock, the agent framework that lets you ditch the prompt-palaver and focus on what you want your agents to achieve!
Flock takes a declarative approach. Think of it like ordering a pizza π: you specify the toppings (your agent's input
and output
), not the 30 steps the chef needs to follow. Flock, powered by modern LLMs and a clever architecture, figures out the "how" for you.
Built with real-world deployment in mind, Flock integrates seamlessly with tools like Temporal for building robust, fault-tolerant, and scalable agent systems right out of the box.
β¨ Why Join the Flock?¶
Traditional Agent Frameworks π | Flock Framework π€π§ππ¦ |
---|---|
π€― Prompt Nightmare | β Declarative Simplicity |
Long, brittle, hard-to-tune prompts | Clear input/output specs (with types!) |
π₯ Fragile & Unpredictable | β‘ Robust & Production-Ready |
Single errors crash the system | Fault-tolerant via Temporal integration |
π§© Monolithic & Rigid | π§ Modular & Flexible |
Hard to extend or modify logic | Pluggable Evaluators, Modules, Routers |
βοΈ Basic Chaining | π Advanced Orchestration |
Often just linear workflows | Dynamic routing, parallel/batch runs |
π‘ Core Ideas¶
Flock's power comes from a few key concepts:
- Declarative Agents: Define agents by what they do (inputs/outputs), not how. Flock uses Evaluators to handle the underlying logic (be it LLM calls, rules, or custom code).
- Modular Components: Extend agent capabilities with pluggable Modules (for memory, metrics, output formatting, etc.) that hook into the agent's lifecycle without touching its core definition.
- Intelligent Workflows: Chain agents explicitly or use Routers (like LLM-based or Agent-based) for dynamic decision-making on the next step.
- Reliable Execution: Run locally for debugging or switch seamlessly to Temporal for production-grade fault tolerance, retries, and state management.
- Type Safety: Leverage Python type hints and Pydantic for clear contracts, validation, and easier integration.
π₯ Hello Flock! - A Quick Taste¶
Building your first agent is refreshingly simple:
import os
from flock.core import Flock, FlockFactory
# --------------------------------
# Define the model
# --------------------------------
# Flock uses litellm to talk to LLMs
# Please consult the litellm documentation for valid IDs:
# https://docs.litellm.ai/docs/providers
MODEL = "openai/gpt-4o"
# --------------------------------
# Create the flock and context
# --------------------------------
# The flock is the place where all the agents are at home
flock = Flock(name="hello_flock", description="This is your first flock!", model=MODEL)
# --------------------------------
# Create an agent
# --------------------------------
# The Flock doesn't believe in prompts (see the docs for more info)
# The Flock just declares what agents get in and what agents produce
# my_presentation_agent takes in a topic and outputs a
# funny_title, fun_slide_headers and fun_slide_summaries
presentation_agent = FlockFactory.create_default_agent(
name="my_presentation_agent",
input="topic",
output="fun_title, fun_slide_headers, fun_slide_summaries"
)
flock.add_agent(presentation_agent)
# --------------------------------
# Run the flock
# --------------------------------
# Tell the flock who the starting agent is and what input to give it
flock.run(
start_agent=presentation_agent,
input={"topic": "A presentation about robot kittens"}
)
That's it! Flock handled turning your simple declaration into the necessary LLM interaction and gave you back a clean, typed Python object.
πΊοΈ Ready to Explore?
-
Dive deeper into the Flock ecosystem:
-
Getting Started: Your first flight β installation and basic usage.
-
Core Concepts: Understand the foundations β Agents, Declarative logic, Workflows.
-
Key Components: Learn about the building blocks β Evaluators, Modules, Tools.
-
Guides: Practical walkthroughs for common tasks like chaining agents.
-
Deployment: Take your Flock to production with Temporal.
π€ Join the Flock Community!
-
Flock is actively developed and welcomes contributions.
-
Check out the code on GitHub
-
Report issues or suggest features.
-
Help us improve the documentation!
Let's build amazing, reliable AI agent systems together! π