OACP Docs
v2.0
Getting StartedComponentsAPI ReferenceExamplesGuides
Getting Started
Introduction
Quick Start
Installation
Basic Usage
Core Concepts
Agents
Agent Systems
Voting Strategies
Storage Backends
Adaptive Prompting
Examples
Research Team
Game AI Simulation
Content Pipeline
Code Review
Advanced Topics
Custom Voting Strategies
Custom Storage Backends
Performance Optimization
Deployment
CLI Commands
Overview
Environment Setup
Monitoring
Log Management
Web Dashboard
Advanced Commands

Quick Start Guide

Get up and running with OACP in minutes. Add governance, voting, and audit trails to your LangGraph workflows.

Installation

# Clone the repository
git clone https://github.com/Aaditya17032002/OACP.git
cd OACP
pip install -e .

# Install dependencies
pip install langgraph

Visit the GitHub repository for the latest updates, issues, and contributions.

Basic Usage

Add OACP governance to your LangGraph nodes using decorators:

from oacp import with_oacp, decision_contract, vote, VoteDecision
from langgraph.graph import StateGraph

# Add governance to a function
@with_oacp(
    role="researcher",
    invariants=["factual_accuracy", "comprehensive_coverage"],
    log_inputs=True,
    log_outputs=True
)
def research_node(state: dict) -> dict:
    """Research node with OACP governance."""
    # Your research logic here
    return {"research_results": "..."}

# Node requiring consensus
@with_oacp(
    role="synthesizer",
    contract=decision_contract(
        required_approvers=["researcher", "analyst", "critic"],
        strategy="unanimous",
        timeout_seconds=30
    )
)
def synthesis_node(state: dict) -> dict:
    """Synthesis node requiring unanimous approval."""
    # Your synthesis logic here
    return {"final_report": "..."}

# Voting function
def reviewer_vote(run_id: str, output: dict):
    vote(
        run_id=run_id,
        voter_id="reviewer",
        decision=VoteDecision.APPROVE,
        reason="Output meets quality standards"
    )

Key Concepts

@with_oacp Decorator

Adds governance to any function with role assignment, invariant checking, and optional consensus requirements.

Decision Contracts

Define voting requirements with required approvers, voting strategy (unanimous/majority/weighted), and timeout settings.

Vote Function

Cast votes with APPROVE, REJECT, or ABSTAIN decisions, including reasons and improvement suggestions.

Event Storage

Persistent audit trail with file, SQLite, or PostgreSQL backends for complete workflow traceability.

Next Steps

Decorators & Integration →

Learn about @with_oacp, wrap_node, and LangGraph integration patterns.

Voting & Consensus →

Explore decision contracts, voting strategies, and consensus mechanisms.

Real Examples →

See the research team and Flappy Bird simulation examples in action.