Skip to main content

Production-ready AI agent framework — meta-package installing the full Haive ecosystem (53+ agents, 22+ RAG variants, 23 game environments, memory + KG, MCP integration)

Project description

Haive — AI Agent Framework

License: MIT Python Versions CI

Production-ready Python framework for building LLM-powered agents. From simple chatbots to complex multi-agent pipelines with persistent memory, RAG, knowledge graphs, and tool ecosystems.

🎯 53+ working agents22+ RAG variants23 game environmentsPostgreSQL + Neo4jMCP integration9 PyPI packages


What is Haive?

Haive is a production-grade framework built on top of LangGraph and LangChain. It fills the gap between raw state machines (LangGraph) and ready-to-use agents — providing a unified abstraction over LLM configuration, tool routing, state management, persistence, and multi-agent composition.

The framework is organized as a monorepo with 9 published PyPI packages, each focused on a specific concern. You can install just the parts you need.

Why not just use LangGraph directly?

LangGraph is powerful but low-level. Building production agents on it requires hand-rolling state schemas, tool routing, validation nodes, and persistence. Haive gives you all of this as a library:

  • State schemas with the right fieldsLLMState, MultiAgentState, etc. that include engines for tool execution
  • Automatic tool routinglangchain_tool, pydantic_model, pydantic_tool, parse_output detected and routed correctly
  • Pre-built agent patterns — SimpleAgent, ReactAgent, MultiAgent, MemoryAgent, 22+ RAG variants
  • Persistence layer — PostgreSQL + Neo4j with sync and async support
  • Memory + KG extraction — automatic knowledge graph construction from conversations
  • No mocks testing — every agent verified end-to-end with real LLMs

Why not LangChain agents?

LangChain agents are simple but limited. They don't compose well, don't have first-class memory, and don't support multi-agent patterns out of the box. Haive's MultiAgent lets you compose any agents into sequential, parallel, or conditional pipelines — and MemoryAgent gives you persistent memory with KG extraction in 3 lines of code.


Packages

Haive is published as 9 PyPI packages, each focused on a specific concern:

Package Version Description Docs
haive-core PyPI Foundation: engines, graphs, schemas, persistence 📖
haive-agents PyPI 53+ production agents (Simple, React, Multi, Memory, RAG, Research) 📖
haive-games PyPI 23 LLM-powered game environments 📖
haive-tools PyPI Tool implementations (search, code, web, APIs) 📖
haive-mcp PyPI Dynamic MCP integration (1,960+ servers) 📖
haive-hap PyPI Haive Agent Protocol (workflow orchestration) 📖
haive-dataflow PyPI Data pipelines & component registry 📖
haive-prebuilt PyPI Pre-configured agent presets 📖
pydevelop-docs PyPI Universal Sphinx docs generator 📖

Installation

# Foundation only
pip install haive-core

# With agents (most common)
pip install haive-agents

# Everything
pip install haive-core haive-agents haive-games haive-tools haive-mcp haive-hap haive-dataflow haive-prebuilt

Quick Start

1. Simple LLM Agent

from haive.agents.simple.agent import SimpleAgent
from haive.core.engine.aug_llm import AugLLMConfig

writer = SimpleAgent(
    name="writer",
    engine=AugLLMConfig(
        temperature=0.8,
        system_message="You are a creative writer.",
    ),
)
result = writer.run("Write a haiku about quantum computing.")

2. Tool-Using Agent (ReAct Pattern)

from haive.agents.react.agent import ReactAgent
from langchain_core.tools import tool

@tool
def calculator(expression: str) -> str:
    """Calculate mathematical expressions."""
    return str(eval(expression, {"__builtins__": {}}))

@tool
def search(query: str) -> str:
    """Search the web."""
    return f"Results for {query}"

researcher = ReactAgent(
    name="researcher",
    engine=AugLLMConfig(tools=[calculator, search]),
    max_iterations=5,
)
result = researcher.run("What is 15 * 23 and how does that compare to the speed of light?")

3. Multi-Agent Pipeline

from haive.agents.multi.agent import MultiAgent

# Sequential: each agent sees previous output
pipeline = MultiAgent(
    name="research_pipeline",
    agents=[researcher, analyzer, writer],
    execution_mode="sequential",
)
result = pipeline.run("Research and write about AI safety")

# Parallel: agents run concurrently
parallel = MultiAgent(
    name="multi_perspective",
    agents=[technical_agent, business_agent, ethical_agent],
    execution_mode="parallel",
)

4. Memory Agent with Knowledge Graph

from haive.agents.memory import create_memory_agent

# Production setup with PostgreSQL + Neo4j
agent = create_memory_agent(
    name="assistant",
    user_id="alice",
    connection_string="postgresql://haive:haive@localhost/haive",
    neo4j_config=True,  # Enable Cypher KG queries
)

# Have a conversation — agent remembers + extracts KG
agent.run("My name is Alice. I work at DeepMind on RL with PyTorch.")
# Auto-saves: memories + KG triples
# (Alice)-[works_at]->(DeepMind)
# (Alice)-[focuses_on]->(reinforcement_learning)
# (Alice)-[uses]->(PyTorch)

agent.run("What do you know about me?")
# Pre-hook loads relevant memories + KG facts as context
# LLM responds with full recall

5. Research Agent (Perplexity-Style)

from haive.agents.research import create_research_agent

agent = create_research_agent(name="researcher", max_search_iterations=8)
# Uses Tavily if TAVILY_API_KEY set, mock otherwise

result = agent.run("What are the latest advances in quantum computing in 2025?")
# QueryAnalyzer → Researcher (search + RAG store) → Synthesizer

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     haive (parent)                          │
│  Main repo — orchestration, demos, docs, docker-compose    │
└─────────────────────────────────────────────────────────────┘
                              │
        ┌─────────────────────┼─────────────────────┐
        ▼                     ▼                     ▼
┌──────────────┐      ┌──────────────┐      ┌──────────────┐
│  haive-core  │  ←   │ haive-agents │  ←   │ haive-games  │
│              │      │              │      │              │
│ • AugLLMConfig│     │ • SimpleAgent │      │ • Chess, Go  │
│ • BaseGraph   │     │ • ReactAgent  │      │ • Among Us   │
│ • State schemas│    │ • MultiAgent  │      │ • Mafia, etc │
│ • Persistence │     │ • MemoryAgent │      │              │
│ • Tool routing│     │ • RAG (22+)   │      │              │
└──────────────┘      └──────────────┘      └──────────────┘
                              │
                              ▼
        ┌──────────────┬─────┴────────┬──────────────┐
        ▼              ▼              ▼              ▼
   ┌─────────┐   ┌─────────┐    ┌─────────┐   ┌──────────┐
   │  tools  │   │   mcp   │    │   hap   │   │ dataflow │
   │         │   │  1960+  │    │workflow │   │ETL/regis │
   └─────────┘   └─────────┘    └─────────┘   └──────────┘

Features

🤖 Agent Catalog (53+ implementations)

  • Foundation: SimpleAgent, ReactAgent, MultiAgent, DynamicSupervisor, Supervisor
  • Memory: MemoryAgent (KG extraction + auto-summarize + Neo4j), LongTermMemoryAgent
  • RAG (22+ variants): Adaptive, Agentic, Dynamic, FLARE, Fusion, HyDE, Self-Reflective, Self-Route, Speculative, Step-Back, Query Planning, Query Decomposition, Memory-Aware, GraphDB-RAG, SQL-RAG
  • Reasoning: Reflexion, LATS (tree search), Reflection, Logic, Tree of Thoughts, Self-Discover
  • Planning: PlanAndExecute, LLMCompiler (DAG), ReWOO
  • Research: Perplexity-style (3-stage), DeepResearch (5-stage)
  • Conversation: 6 patterns (Debate, Round Robin, Social Media, Collaborative, Directed)

🧠 Memory & Knowledge

  • Persistent memory — PostgreSQL with pgvector, async support
  • Auto-context — searches store before each response, injects relevant facts
  • KG extraction — automatic triple extraction from conversations
  • Neo4j integration — Cypher queries on the knowledge graph
  • Auto-summarization — manages context length with rolling summaries
  • GraphDB-RAG — natural language → Cypher → graph traversal

🛠️ Infrastructure

  • Docker Compose — PostgreSQL (pgvector) + Neo4j (APOC) ready
  • LangSmith tracing — built-in observability
  • Rich trace utilityhaive.agents.utils.trace.run_traced(agent, "...") for clean output
  • 80+ demos — every agent has a runnable demo in demos/

🔌 Tool Ecosystem

  • Static tools (haive-tools): Tavily, Google, calculators, code execution, APIs
  • Dynamic tools (haive-mcp): Search and integrate from 1,960+ MCP servers at runtime
  • Custom tools: LangChain @tool, Pydantic models, callables — all supported
  • Tool routing: automatic detection and routing to correct execution path

Documentation

Resource Link
📖 Per-package docs https://pr1m8.github.io/haive-core/
🎯 Agent design patterns project_docs/guides/agent/AGENT_DESIGN_PATTERNS.md
🧠 Memory agent guide project_docs/guides/agent/MEMORY_AGENT_GUIDE.md
🤖 Multi-agent state design project_docs/guides/agent/MULTIAGENT_STATE_DESIGN.md
🪢 Custom nodes & graphs project_docs/guides/agent/CUSTOM_NODES_AND_GRAPHS.md
🔧 State schema notes project_docs/guides/agent/STATE_SCHEMA_NOTES.md
🎮 Demos demos/agents/ and demos/games/

Development

# Clone with submodules
git clone --recursive https://github.com/pr1m8/haive.git
cd haive

# Install
poetry install

# Start Postgres + Neo4j
docker-compose up -d

# Run an agent demo
poetry run python demos/agents/03_react_agent.py
poetry run python demos/agents/memory_agent_e2e.py
poetry run python demos/agents/50_research_agent.py

# Run a game demo
poetry run python demos/games/14_chess.py
poetry run python demos/games/28_among_us.py

Working with Submodules

Each package is its own Git repo. To work on one:

cd packages/haive-agents
# Make your changes
git add ... && git commit -m "..." && git push origin main

cd ../..
git add packages/haive-agents
git commit -m "chore: update haive-agents submodule"
git push origin main

License

MIT © pr1m8

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

haive-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

haive-1.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file haive-1.0.0.tar.gz.

File metadata

  • Download URL: haive-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for haive-1.0.0.tar.gz
Algorithm Hash digest
SHA256 75aa31f381615f3c5601360f0d6eb7f09fdedf9821125a287b6f133ad7947f0d
MD5 f54afb32ed757689eb608300df97464a
BLAKE2b-256 aee38d4998cbaf8da9e90400b0247d865f3662c0bdf6ec062b81d4b1717d86ad

See more details on using hashes here.

File details

Details for the file haive-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: haive-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for haive-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c81f22f0faa55ae6aa521f67bb1aac0c746eb0378e0ad6694d4231d1cecc011
MD5 299f6382530bb1f528968dc9f29a9fb7
BLAKE2b-256 7687332b21bf056776190fc1ad2e4238428208dccaecb4fad356f0b84dde4e17

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