Skip to main content

Hive Agents - AI-powered scaffolding for Agno agents - YAML-first DevX layer

Project description

Automagik Hive

Scaffolding and Smart RAG for Agno

AI-powered agent generation with intelligent CSV knowledge bases

PyPI version Python 3.11+ Downloads Build Status License Discord Roadmap

Quick Start โ€ข Features โ€ข Examples โ€ข ๐Ÿ—บ๏ธ Roadmap โ€ข Contributing


What is Automagik Hive?

Hive doesn't compete with Agno - it makes it easier to use.

Think of Hive as "Create React App" for Agno agents. Instead of weeks setting up project structure, writing boilerplate, and researching optimal configurations, Hive gives you:

  • ๐Ÿค– AI-Powered Generation - Describe what you want; Hive's meta-agent generates optimal configs
  • ๐Ÿ”„ Smart CSV RAG - Hash-based incremental loading (450x faster, 99% cost savings)
  • ๐ŸŽฏ YAML-First Config - No Python boilerplate, just declarative configs
  • ๐Ÿ“ฆ Project Scaffolding - Zero to agent in 30 seconds

Built by practitioners who got tired of manually setting up the same patterns. Powered entirely by Agno.


Key Features

๐Ÿค– AI That Generates AI

Use an Agno agent to generate Agno agent configurations. Natural language requirements โ†’ optimal YAML configs.

$ hive ai support-bot --interactive

๐Ÿค– AI-Powered Agent Generator
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

๐Ÿ’ญ What should your agent do?
> Customer support bot with CSV knowledge base

๐Ÿง  Analyzing requirements...
โœ… Generated successfully!

๐Ÿ’ก AI Recommendations:
  โ€ข Model: gpt-4o-mini (cost-effective for support)
  โ€ข Tools: CSVTools, WebSearch
  โ€ข Complexity: 4/10
  โ€ข Estimated cost: $0.002/query

๐Ÿ“‹ Generated: ai/agents/support-bot/config.yaml

How it works:

  1. Meta-agent analyzes natural language requirements
  2. Selects optimal model from 7+ providers (OpenAI, Anthropic, Google, etc.)
  3. Recommends tools from Agno's builtin catalog
  4. Generates context-aware system instructions
  5. Creates production-ready YAML configuration

Not keyword matching - real LLM intelligence.

๐Ÿ”„ Smart CSV RAG System

The one feature from V1 worth keeping - hash-based incremental CSV loading:

from hive.knowledge import create_knowledge_base

# Smart loading with hot reload
kb = create_knowledge_base(
    csv_path="data/faqs.csv",
    embedder="text-embedding-3-small",
    num_documents=5,
    hot_reload=True  # Watches for changes
)

# Only re-embeds changed rows
# MD5 hash tracking prevents redundant processing

Performance Numbers:

  • โœ… 450x faster - Hot reload for unchanged CSVs
  • โœ… 10x faster - Small updates (only changed rows)
  • โœ… 99% cost savings - No redundant embeddings
  • โœ… 18/18 tests passing - Production-ready

Real-world impact: $700+/year savings at scale.

๐ŸŽฏ YAML-First Agent Design

No Python boilerplate. Just declarative configurations:

agent:
  name: "Customer Support Bot"
  agent_id: "support-bot"
  version: "1.0.0"

model:
  provider: "openai"
  id: "gpt-4o-mini"
  temperature: 0.7

instructions: |
  You are a friendly customer support agent.
  Answer questions using the knowledge base.
  When unsure, escalate to human support.

tools:
  - name: CSVTools
    csv_path: "./data/faqs.csv"
  - name: WebSearch

storage:
  table_name: "support_bot_sessions"
  auto_upgrade_schema: true

Want to extend with Python? Just create agent.py:

from agno.agent import Agent
from hive.discovery import discover_config

def get_support_bot(**kwargs):
    config = discover_config()  # Loads config.yaml
    return Agent(
        name=config['agent']['name'],
        # ... custom logic here
        **kwargs
    )

๐Ÿ“ฆ Project Scaffolding

Opinionated structure that scales:

my-project/
โ”œโ”€โ”€ ai/                         # All AI components
โ”‚   โ”œโ”€โ”€ agents/                 # Agent definitions
โ”‚   โ”‚   โ”œโ”€โ”€ examples/           # Built-in examples (learning)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ support-bot/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ code-reviewer/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ researcher/
โ”‚   โ”‚   โ””โ”€โ”€ [your-agents]/      # Your custom agents
โ”‚   โ”œโ”€โ”€ teams/                  # Multi-agent teams
โ”‚   โ”œโ”€โ”€ workflows/              # Step-based workflows
โ”‚   โ””โ”€โ”€ tools/                  # Custom tools
โ”‚
โ”œโ”€โ”€ data/                       # Knowledge bases
โ”‚   โ”œโ”€โ”€ csv/                    # CSV files
โ”‚   โ””โ”€โ”€ documents/              # Document stores
โ”‚
โ”œโ”€โ”€ .env                        # Environment config
โ”œโ”€โ”€ hive.yaml                   # Project settings
โ””โ”€โ”€ pyproject.toml              # Dependencies

๐Ÿš€ Built on Agno's Power

Hive is a thin layer over Agno. You get all of Agno's features:

  • Performance: 3ฮผs agent instantiation, 6.5KB memory per agent
  • Native tools: 20+ production-ready tools (web search, code execution, file ops, etc.)
  • Storage: PostgreSQL, SQLite with auto-schema migration
  • Playground: Auto-generated API with OpenAPI docs
  • Workflows: Sequential, parallel, conditional, looping
  • Teams: Automatic routing, collaboration, coordination

๐Ÿ› ๏ธ Builtin Tools Catalog

Easy access to Agno's tools with metadata and recommendations:

Category Tools
Execution PythonTools, ShellTools
Web DuckDuckGoTools, TavilyTools, WebpageTools
Files FileTools, CSVTools
Data PandasTools, PostgresTools
APIs SlackTools, EmailTools, GitHubTools
from hive.config.builtin_tools import BUILTIN_TOOLS

# Browse tools
for tool_name, info in BUILTIN_TOOLS.items():
    print(f"{tool_name}: {info['description']}")

๐Ÿ”ฅ Hot Reload

Change configs, see results instantly:

$ hive dev  # Starts dev server

# Edit ai/agents/my-bot/config.yaml
# Server automatically reloads
# Test at http://localhost:8886/docs

๐Ÿข Enterprise-Ready

When you're ready for production:

  • โœ… PostgreSQL with PgVector (hybrid search, HNSW indexing)
  • โœ… Environment-based configuration (dev/staging/prod)
  • โœ… API authentication with cryptographic keys
  • โœ… Structured logging with Loguru
  • โœ… Type safety with Pydantic validation
  • โœ… Test coverage (87% pass rate, 147 tests)

Quick Start

Prerequisites

  • Python 3.11+ (3.12 recommended)
  • At least one AI provider API key:
    • OpenAI (OPENAI_API_KEY)
    • Anthropic (ANTHROPIC_API_KEY)
    • Google (GEMINI_API_KEY)

Installation

# Install via uvx (recommended - no pollution)
uvx automagik-hive --help

# Or install globally with uv
uv pip install automagik-hive

# Or install with pip
pip install automagik-hive

Create Your First Agent (30 seconds)

# 1. Initialize project
uvx automagik-hive init my-project
cd my-project

# 2. Create API keys file
cp .env.example .env
# Edit .env and add your API keys

# 3a. Template-based creation (fast)
hive create agent my-bot

# 3b. AI-powered creation (optimal)
hive ai my-bot --description "Customer support bot with FAQ knowledge"

# 4. Start development server
hive dev

# 5. Access API docs
open http://localhost:8886/docs

Your First Conversation

# Via CLI
curl -X POST http://localhost:8886/agents/my-bot/runs \
  -H "Content-Type: application/json" \
  -d '{"message": "How do I reset my password?"}'

# Via Python
from agno.agent import Agent

agent = Agent.load("ai/agents/my-bot")
response = agent.run("How do I reset my password?")
print(response.content)

Real-World Examples

Customer Support Router

Problem: Route support queries to specialized agents (billing, technical, general)

# ai/teams/support-router/config.yaml
team:
  name: "Support Router"
  team_id: "support-router"
  mode: "route"  # Agno handles routing automatically

members:
  - "billing-agent"
  - "technical-agent"
  - "general-agent"

instructions: |
  You are a support routing system.

  Route queries based on topic:
  - Billing: payments, invoices, refunds
  - Technical: bugs, errors, integrations
  - General: questions, information, other

Result: Automatic routing, no manual orchestration code needed.

Knowledge-Powered Agent

Problem: Answer customer questions from FAQ database

agent:
  name: "FAQ Bot"
  agent_id: "faq-bot"

model:
  provider: "openai"
  id: "gpt-4o-mini"

tools:
  - name: CSVTools
    csv_path: "./data/faqs.csv"

instructions: |
  Search the FAQ database for answers.
  Provide concise, helpful responses.
  If no match found, offer to escalate.

Setup CSV:

question,answer,category
How do I reset password?,Go to Settings > Security > Reset Password,account
What are your hours?,We're available 24/7 via chat and email,general
How do refunds work?,Refunds process in 5-7 business days,billing

Smart loading: Only re-embeds changed rows, saves 99% on embedding costs.

Code Review Workflow

Problem: Automated code review with security checks

# ai/workflows/code-review/config.yaml
workflow:
  name: "Security Code Review"
  workflow_id: "code-review"

steps:
  - name: "static_analysis"
    agent: "security-scanner"

  - name: "review"
    agent: "code-reviewer"
    tools:
      - PythonTools
      - FileTools

  - name: "report"
    function: "generate_report"

Result: Comprehensive reviews covering OWASP Top 10, best practices, and fix suggestions.


Architecture That Scales

Project Structure

my-project/
โ”œโ”€โ”€ ai/                         # AI components (auto-discovered)
โ”‚   โ”œโ”€โ”€ agents/                 # Agents (YAML + optional Python)
โ”‚   โ”œโ”€โ”€ teams/                  # Multi-agent teams
โ”‚   โ”œโ”€โ”€ workflows/              # Step-based workflows
โ”‚   โ””โ”€โ”€ tools/                  # Custom tools
โ”‚
โ”œโ”€โ”€ data/                       # Knowledge bases
โ”‚   โ”œโ”€โ”€ csv/                    # CSV files (with hot reload)
โ”‚   โ””โ”€โ”€ documents/              # Other documents
โ”‚
โ”œโ”€โ”€ .env                        # Environment variables
โ”œโ”€โ”€ hive.yaml                   # Project configuration
โ””โ”€โ”€ pyproject.toml              # Python dependencies

Auto-Generated API

$ hive dev

# Agno Playground generates:
GET  /                          # API info
GET  /health                    # Health check
GET  /agents                    # List agents
POST /agents/{id}/runs          # Run agent
GET  /agents/{id}/sessions      # Get sessions
POST /teams/{id}/runs           # Run team
POST /workflows/{id}/runs       # Run workflow

Full OpenAPI docs at /docs.


CLI Commands

# Project Management
hive init <project-name>                  # Initialize new project
hive version                              # Show version

# Component Creation - Templates
hive create agent <name>                  # Create agent from template
hive create team <name>                   # Create team
hive create workflow <name>               # Create workflow
hive create tool <name>                   # Create custom tool

# Component Creation - AI-Powered โญ
hive ai <agent-name> --interactive        # Interactive AI generation
hive ai <agent-name> --description "..."  # Generate from description

# Development
hive dev                                  # Start dev server (hot reload)
hive dev --port 8000                      # Custom port
hive dev --examples                       # Run with built-in examples

# Production
hive serve                                # Start production server
hive serve --port 8000                    # Custom port

Database Backend Selection

Hive supports multiple database backends for different use cases:

Backend Best For Setup Performance Features
PostgreSQL Production Docker โญโญโญโญโญ Full text search, PgVector, HNSW
SQLite Development None โญโญโญ File-based, good for testing

PostgreSQL (Recommended for Production)

# Start PostgreSQL with Docker
docker run -d \
  --name hive-postgres \
  -e POSTGRES_PASSWORD=your_password \
  -e POSTGRES_DB=hive \
  -p 5432:5432 \
  pgvector/pgvector:latest

# Update .env
HIVE_DATABASE_URL=postgresql://postgres:your_password@localhost:5432/hive

Features:

  • PgVector for hybrid search
  • HNSW indexing (fast vector similarity)
  • Full-text search
  • Auto-schema migration
  • Production-ready

SQLite (Development Only)

# Update .env
HIVE_DATABASE_URL=sqlite:///./data/hive.db

Limitations:

  • No concurrent writes
  • No vector similarity search
  • File locking issues under load
  • Not recommended for production

Environment Configuration

Minimal .env (20 vars, not 145!):

# Core (Required)
HIVE_ENVIRONMENT=development              # development|staging|production
HIVE_API_PORT=8886                        # API server port
HIVE_DATABASE_URL=postgresql://...        # Database connection
HIVE_API_KEY=hive_your_32_char_key        # API authentication

# AI Providers (At least one required)
OPENAI_API_KEY=sk-...                     # OpenAI models
ANTHROPIC_API_KEY=sk-ant-...              # Claude models
GEMINI_API_KEY=...                        # Google models

# Optional
HIVE_LOG_LEVEL=INFO                       # DEBUG|INFO|WARNING|ERROR
HIVE_VERBOSE_LOGS=false                   # Detailed logging
HIVE_ENABLE_METRICS=true                  # Performance tracking
HIVE_CORS_ORIGINS=http://localhost:3000   # Comma-separated origins

Development

# Clone repository
git clone https://github.com/namastexlabs/automagik-hive
cd automagik-hive

# Install dependencies
uv sync

# Run tests
uv run pytest                              # All tests
uv run pytest tests/hive/knowledge/        # Knowledge tests
uv run pytest -v --cov=hive                # With coverage

# Lint & format
uv run ruff check --fix
uv run ruff format

# Type check
uv run mypy hive/

# Start examples
uv run python hive/examples/agents/demo_all_agents.py

Why Hive vs Pure Agno?

Feature Pure Agno Hive + Agno
Agent Creation Write Python factories YAML or AI generation
Getting Started Read docs, write boilerplate hive init โ†’ instant project
Knowledge Base Setup PgVector, write loaders create_knowledge_base() with hot reload
Model Selection Research 7+ providers AI recommends optimal choice
Tool Selection Browse Agno tools Catalog + AI recommendations
CSV RAG Write custom incremental loader Built-in hash-based incremental
Project Structure DIY Opinionated ai/ structure

Hive = Scaffolding for Agno

Like Create React App for React, Hive removes setup friction without replacing the framework.


What Hive Does NOT Do

โŒ Compete with Agno - We extend it, don't replace it โŒ Reinvent orchestration - Use Agno's native teams/workflows โŒ Lock you in - Generated code is pure Agno, you own it โŒ Replace your code - We scaffold, you customize


Roadmap

V2.0 (Current) โœ…

  • AI-powered agent generation with meta-agent
  • Smart CSV RAG with hash-based incremental loading
  • YAML-first configuration
  • Project scaffolding with examples
  • Builtin tools catalog
  • Hot reload for dev server

V2.1 - Enhanced DevX ๐Ÿš€

  • Interactive TUI for agent creation
  • Live agent testing in terminal
  • Knowledge base quality scoring
  • Tool compatibility checker
  • Agent performance profiling

V2.2 - Production Features ๐ŸŒŸ

  • Multi-environment configs (dev/staging/prod)
  • Cost tracking and optimization
  • Deployment helpers (Docker, AWS, Fly.io)
  • Agent monitoring dashboard
  • Workflow visualization

Enterprise Features

Security & Authentication

  • โœ… Cryptographic API key generation (secrets.token_urlsafe)
  • โœ… Constant-time validation (prevents timing attacks)
  • โœ… Environment-based security (auto-enabled in production)
  • โœ… Input validation (size limits, sanitization)

Database & Storage

  • โœ… PostgreSQL with PgVector (hybrid search)
  • โœ… SQLite for development
  • โœ… Auto-schema migration
  • โœ… Session persistence

Monitoring & Observability

  • โœ… Structured logging (Loguru)
  • โœ… Automatic emoji mapping
  • โœ… Performance metrics
  • โœ… Error tracking

Deployment

  • โœ… Docker-ready
  • โœ… Environment scaling (dev/staging/prod)
  • โœ… Health checks
  • โœ… Graceful shutdown

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Areas for contribution:

  • Additional builtin tool integrations
  • Example agents for common use cases
  • Documentation improvements
  • Bug fixes and performance optimizations

Acknowledgments

Powered by:

  • Agno - The AI agent framework powering everything
  • UV - Modern Python packaging and project management
  • Typer - Beautiful CLI framework
  • Rich - Terminal output that doesn't suck
  • Pydantic - Data validation with type hints
  • FastAPI - Modern web framework (via Agno)

License

MIT License - see LICENSE for details.


Links


Built with โค๏ธ by practitioners who got tired of boilerplate.

Remember: Hive doesn't compete with Agno. We make it easier to use. ๐Ÿš€

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

automagik_hive-1.0.0rc3.tar.gz (899.6 kB view details)

Uploaded Source

Built Distribution

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

automagik_hive-1.0.0rc3-py3-none-any.whl (175.4 kB view details)

Uploaded Python 3

File details

Details for the file automagik_hive-1.0.0rc3.tar.gz.

File metadata

  • Download URL: automagik_hive-1.0.0rc3.tar.gz
  • Upload date:
  • Size: 899.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for automagik_hive-1.0.0rc3.tar.gz
Algorithm Hash digest
SHA256 91ad28675af6b4fda1bd3d67c3f147967aef0466875fe264c130f71200f530f3
MD5 b2e68a3f9ab4b06af9565cd5bc64d2c7
BLAKE2b-256 86f397a1cace5d8688380f100ba0a8041b6fc1c35b11a12007433e8e7d38f106

See more details on using hashes here.

Provenance

The following attestation bundles were made for automagik_hive-1.0.0rc3.tar.gz:

Publisher: publish-pypi.yml on namastexlabs/automagik-hive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file automagik_hive-1.0.0rc3-py3-none-any.whl.

File metadata

File hashes

Hashes for automagik_hive-1.0.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 5357b9e628fb29f82534ffd8686af360fd7ee1c81ca2407b695691769e7610ae
MD5 1e8ddb60ff6bd25fb4249ec234a4c598
BLAKE2b-256 01320927cb2640a89c1d0d28062acf1b5138be37106e7494b2dcd2cb87998031

See more details on using hashes here.

Provenance

The following attestation bundles were made for automagik_hive-1.0.0rc3-py3-none-any.whl:

Publisher: publish-pypi.yml on namastexlabs/automagik-hive

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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