Use Cases
ACP applies wherever you need reliable, verifiable agreement between multiple AI models. Below are 10 practical applications, each with a problem statement, ACP solution, working code example, and concrete benefits.
Configuration guidance
Each use case includes recommended model counts, iteration limits, and D-thresholds. See the performance table at the bottom for a full comparison, and the configuration guide for detailed selection advice.
1. Fact-Checking and Verification
Problem
Single AI models can hallucinate or provide outdated information. There is no built-in mechanism to verify that a response is factually correct.
ACP Solution
Multiple models reach consensus on verifiable facts, grounded in fundamental axioms. When all models independently arrive at the same answer -- and that answer is anchored to a known axiom -- the result carries strong evidence of correctness.
from src.engine import ConsensusEngine, ConsensusConfig
from src.llm.openrouter_llm import OpenRouterLLM
engine = ConsensusEngine(models=["gpt-5.4", "claude", "gemini"])
result = await engine.run(
query="What is the speed of light in vacuum?",
axiom_level=[2] # Physical axioms
)
# Result: Consensus on "299,792,458 m/s"
# D-score: 0.0 (perfect agreement)
# Axiom: acp-phys-light-speed-v1Applications
- Scientific fact verification
- Historical event validation
- Mathematical constant lookup
- Protocol specification checking
Benefits
- Accuracy -- multiple models reduce hallucination risk
- Traceability -- axiom grounding provides verifiable proof
- Confidence -- D-score indicates certainty level numerically
2. Code Review and Bug Detection
Problem
Manual code reviews are time-consuming and can miss subtle bugs. Automated static analysis tools generate false positives and lack contextual understanding of intent.
ACP Solution
Multiple AI models review code in parallel, reaching consensus on correctness, bugs, and best practices. The Sonata structure (3 models) provides balanced analysis with conflict resolution.
code = """
def factorial(n):
if n == 0:
return 1
return n * factorial(n-1)
"""
result = await engine.run(
query=f"Review this factorial function for bugs:\n{code}",
structure="sonata" # 3 models for balanced review
)
# Consensus: "Missing base case for n=1, potential infinite
# recursion for n<0"
# D-score: 0.08 (strong agreement on the issues found)Applications
- Automated code review in CI/CD pipelines
- Security vulnerability detection
- Algorithm correctness verification
- Code quality assessment
Benefits
- Comprehensive -- multiple perspectives catch more issues
- Contextual -- understands intent, not just syntax
- Explanatory -- provides rationale for each finding
3. Technology Decision Making
Problem
Choosing between technologies (PostgreSQL vs MongoDB, REST vs GraphQL) involves subjective trade-offs. Individual opinions carry bias, and online resources often conflict.
ACP Solution
Consensus synthesis of expert knowledge from multiple AI models. The Concert structure (5+ models) provides diverse perspectives for complex decisions that benefit from broader input.
result = await engine.run(
query="Should I use PostgreSQL or MongoDB for a social network?",
structure="concert", # 5+ models for complex decisions
max_iterations=10
)
# Consensus: "PostgreSQL for relationships and ACID compliance,
# MongoDB for flexibility in user-generated content..."
# Includes trade-offs, use case considerations, and recommendations
# D-score: 0.18 (moderate consensus -- expected for subjective topics)Applications
- Architecture decisions
- Tool and framework selection
- Framework and library comparisons
- Infrastructure choices
Benefits
- Balanced -- multiple viewpoints reduce individual bias
- Comprehensive -- covers trade-offs from multiple angles
- Actionable -- converges on clear recommendations
4. Research Synthesis
Problem
Synthesizing information from multiple sources is time-consuming and prone to confirmation bias. A single model may favor certain sources or perspectives.
ACP Solution
AI models independently research a topic and converge on a consensus summary. Using computable, architectural, and protocol axioms (levels 4-6) grounds the synthesis in verifiable technical facts.
result = await engine.run(
query="What are current best practices for password hashing?",
axiom_level=[4, 5, 6] # Computable + architectural + protocol axioms
)
# Consensus: "Argon2id is the current recommendation (OWASP 2024),
# bcrypt is acceptable as a fallback. Key parameters: memory cost
# >= 19 MiB, iterations >= 2, parallelism >= 1."
# D-score: 0.06 (strong consensus on established best practices)Applications
- Literature reviews and state-of-the-art surveys
- Best practices research
- Technology evaluation
- Technical documentation synthesis
Benefits
- Up-to-date -- multiple models have diverse training data cutoffs
- Consensus-driven -- filters out outlier opinions and fringe sources
- Structured -- organized synthesis with clear attribution
5. Educational Q&A
Problem
Students need reliable answers to learning questions, but single AI tutors can produce inconsistent or misleading explanations. There is no way to gauge whether an answer is trustworthy.
ACP Solution
Consensus-based answers with transparent confidence scores. The Fugue structure (2 models) is efficient for straightforward educational queries, keeping costs low while still providing verification.
result = await engine.run(
query="Explain the difference between processes and threads",
structure="fugue" # 2 models for simple educational queries
)
# D-score: 0.12 (good consensus)
# Consensus answer with clear explanation covering:
# - Memory isolation vs shared memory
# - Context switching costs
# - Use cases for eachApplications
- Interactive tutoring systems
- Homework help with confidence scoring
- Concept clarification
- Study guide generation
Benefits
- Reliable -- consensus reduces misinformation
- Transparent -- D-score shows answer certainty to students
- Pedagogical -- multiple perspectives aid understanding
6. API Design Validation
Problem
API design decisions affect long-term maintainability. Inconsistent designs cause technical debt, and manual reviews cannot enforce organizational standards systematically.
ACP Solution
Validate API designs against custom axioms that encode your organization's standards. Models reach consensus on whether a proposed endpoint meets the defined constraints.
custom_axioms = [
"APIs must be RESTful",
"Response time < 200ms (P99)",
"All endpoints require authentication"
]
result = await engine.run(
query="Should we add a /users/:id/posts/recent endpoint?",
relevant_axioms=custom_axioms
)
# Consensus validates against each custom axiom
# D-score: 0.09 (strong agreement on compliance assessment)Applications
- API design review
- Endpoint validation against standards
- REST compliance checking
- Performance requirement verification
Benefits
- Consistent -- enforces organizational standards uniformly
- Automated -- reduces manual review time
- Documented -- axioms serve as living documentation of standards
7. Security Auditing
Problem
Security vulnerabilities are critical but hard to detect systematically. Traditional scanners miss context-dependent vulnerabilities, and manual audits are expensive.
ACP Solution
Consensus-based security review across multiple AI models trained on security patterns. When multiple models independently identify the same vulnerability, confidence is high and false positives are reduced.
result = await engine.run(
query=f"Review this code for security vulnerabilities:\n{sql_query_code}",
axiom_level=[4, 5, 6] # Computable + architectural + protocol
)
# Consensus: "SQL injection vulnerability detected in line 12.
# User input is concatenated directly into the query string
# without parameterization."
# Multiple models independently identify the same issue
# D-score: 0.04 (very strong consensus on the vulnerability)Applications
- SQL injection detection
- XSS vulnerability scanning
- Authentication flow review
- Cryptography implementation audit
Benefits
- Comprehensive -- multiple security perspectives cover more attack vectors
- Consensus validation -- reduces false positives by requiring model agreement
- Explanatory -- provides remediation guidance with each finding
8. Documentation Quality Control
Problem
Documentation can become outdated, contain factual errors, or use unclear explanations. Manual verification does not scale with large codebases.
ACP Solution
Validate documentation accuracy through consensus using linguistic axioms (level 7). Models cross-reference claims against their training data and agree on whether statements are current and correct.
result = await engine.run(
query="Is this documentation accurate: 'Python 3.12 uses GIL by default'?",
axiom_level=[7] # Linguistic axioms
)
# Consensus verifies against current Python specifications
# Models agree on the accuracy and note any caveats
# D-score: 0.03 (very strong consensus on verifiable fact)Applications
- Documentation verification during build pipelines
- Tutorial validation
- README accuracy checking
- API documentation review
Benefits
- Accuracy -- multiple sources confirm factual claims
- Currency -- detects outdated information by cross-referencing
- Clarity -- identifies confusing or ambiguous explanations
9. Automated Moderation
Problem
Content moderation requires consistent policy enforcement at scale. Single-model decisions can be biased or inconsistent, and human moderators cannot review every piece of content.
ACP Solution
Consensus-based moderation decisions against policy axioms. By encoding community guidelines as axioms, multiple models evaluate content against the same explicit rules.
policy_axioms = [
"No personal attacks",
"No spam or self-promotion",
"Stay on topic"
]
result = await engine.run(
query=f"Does this comment violate community guidelines: '{user_comment}'",
relevant_axioms=policy_axioms
)
# Consensus: "Violates 'no personal attacks' policy"
# D-score: 0.07 (strong agreement on the violation)Applications
- Comment moderation
- Content flagging and classification
- Policy enforcement at scale
- Community management
Benefits
- Consistent -- same policies applied uniformly across all content
- Fair -- multiple perspectives reduce individual model bias
- Transparent -- axioms make enforcement policies explicit and auditable
10. Compliance Validation
Problem
Regulatory compliance requires systematic validation against complex, evolving requirements. Manual compliance checks are expensive, slow, and prone to human oversight.
ACP Solution
Map compliance requirements to axioms and validate through consensus. Each regulatory requirement becomes an axiom that models evaluate against, producing a systematic audit trail.
gdpr_axioms = [
"User data must be deletable on request (Right to erasure)",
"Consent must be explicit and documented",
"Data processing must have legal basis"
]
result = await engine.run(
query="Does our user registration flow comply with GDPR?",
relevant_axioms=gdpr_axioms
)
# Consensus validates each requirement individually
# Provides specific findings per axiom
# D-score: 0.11 (good consensus on compliance assessment)Applications
- GDPR compliance
- HIPAA validation
- SOC 2 auditing
- Industry standards compliance
Benefits
- Systematic -- all requirements checked against explicit axioms
- Documented -- audit trail via axiom-grounded consensus results
- Automated -- reduces manual compliance work significantly
Performance Characteristics
The following table summarizes recommended configurations and approximate costs for each use case. Costs are based on OpenRouter pricing and vary with model selection.
| Use Case | D-threshold | Models | Iterations | Cost/Query |
|---|---|---|---|---|
| Fact-Checking | 0.05 | 3 | 1-3 | $0.02-0.05 |
| Code Review | 0.15 | 3 | 3-5 | $0.05-0.10 |
| Tech Decisions | 0.20 | 5 | 5-10 | $0.10-0.25 |
| Research | 0.20 | 3-5 | 7-12 | $0.15-0.30 |
| Education | 0.15 | 2 | 2-4 | $0.03-0.06 |
| Security | 0.10 | 3-5 | 3-7 | $0.08-0.15 |
| Compliance | 0.10 | 3 | 5-8 | $0.10-0.20 |
Choosing the Right Configuration
Model count
- 2 models (Fugue) -- Simple queries, fact-checking, education. Lowest cost, fastest execution.
- 3 models (Sonata) -- Code review, general research, security. Good balance of thoroughness and cost.
- 5+ models (Concert) -- Complex decisions, critical compliance, high-stakes validations. Maximum coverage at higher cost.
Iteration limit
- 1-3 iterations -- Clear facts, simple questions. Most factual queries converge in 1-2 rounds.
- 5-7 iterations -- Code review, moderate complexity. Allows models to refine and converge.
- 10-15 iterations -- Research synthesis, complex decisions. Gives models room to explore and settle on nuanced consensus.
D-threshold
< 0.05-- Strict consensus required (facts, security findings)0.05-0.15-- Good consensus (code review, education)0.15-0.30-- Moderate consensus acceptable (opinions, complex decisions)
Integration Patterns
CI/CD pipeline
Add ACP code review as a step in your GitHub Actions or CI workflow.
- name: ACP Code Review
run: |
python scripts/acp-review.py --files changed_files.txtAPI gateway
Use ACP to validate suspicious requests before they reach your application.
@app.before_request
async def validate_request():
if is_suspicious(request):
consensus = await acp.run(
query=f"Is this request malicious: {request}",
axiom_level=[6] # Protocol axioms
)
if consensus.final_D < 0.1: # High confidence
abort(403)Documentation build
Validate documentation accuracy as part of your build process.
for doc_file in docs:
result = await acp.run(
query=f"Verify accuracy: {doc_content}",
axiom_level=[7]
)
if result.final_D > 0.2:
warnings.append(f"{doc_file}: Low consensus on accuracy")Best Practices
- Choose appropriate axiom levels -- Match axioms to your domain. Use physical axioms for scientific facts, protocol axioms for API validation, linguistic axioms for documentation.
- Set realistic D-thresholds -- Do not expect perfect consensus on subjective topics. A D-score of 0.20 for a technology decision is excellent.
- Monitor costs -- Limit iterations for expensive queries. Use cheaper models during development and testing.
- Cache results -- Reuse consensus for identical or semantically similar queries via the semantic cache.
- Combine with traditional tools -- ACP complements, not replaces, existing systems like linters, static analysis, and manual review.
Next steps
Ready to write code? See the Code Examples guide for 5 working examples you can run immediately. For deployment, consult the Self-Hosting guide.