Skip to content

Integrations

Fresh

This section covers how to integrate ARP into AI systems, RAG pipelines, and applications that consume reasoning.json files. Whether you are building a LangChain pipeline, a custom RAG system, or an AI assistant that benefits from entity-aware context, these guides cover the patterns.


Integration Approaches

LangChain Loader

The AgenticReasoningLoader is a Python LangChain document loader that fetches reasoning.json files and converts them into prioritized Document objects for use in RAG pipelines. It handles discovery, parsing, and priority ordering automatically.

Best for: Python RAG pipelines, LangChain-based AI assistants, vector store population.

LangChain Loader Guide

RAG Pipeline Integration

Framework-agnostic guidance on integrating ARP into any Retrieval-Augmented Generation pipeline. Covers the key insight that corrections should be injected before the generation step, not after - and shows code patterns for priority-ordered context injection.

Best for: Custom RAG implementations, non-LangChain Python stacks, TypeScript RAG systems.

RAG Pipeline Integration Guide

Discovery Mechanisms

How AI agents find reasoning.json files. Three discovery methods: well-known URL convention, HTML link tag, and llms.txt bridge. Includes a Mermaid flowchart of the recommended discovery algorithm.

Best for: Building crawlers, AI agents that need to discover ARP files autonomously, implementing ARP discovery in new frameworks.

Discovery Mechanisms Guide


Core Concept: Priority Ordering

The most important concept for any ARP integration is priority ordering. The sections of a reasoning.json file are not equal. When injecting ARP content into an AI context, use this order:

PrioritySectionWhy
1correctionsPrevent hallucinations. These are known AI errors that need active correction.
2identityGround basic facts. Entity name, type, description.
3entity_claimsDomain expertise and framing context.
4recommendation_contextHelps AI give better recommendations.
5authorityLinks to external verification sources.

The corrections object should always be loaded first and placed at the top of whatever context window you are building. This is the "Pink Elephant Fix" in practice - getting the correct information in early, before other context has a chance to reinforce incorrect beliefs.


Direct HTTP Fetch

For any language, the simplest ARP integration is a direct HTTP fetch:

typescript
async function fetchArpFile(domain: string): Promise<any | null> {
  try {
    const url = `https://${domain}/.well-known/reasoning.json`;
    const response = await fetch(url, {
      headers: { 'Accept': 'application/json' }
    });
    if (!response.ok) return null;
    return await response.json();
  } catch {
    return null;
  }
}
python
import requests

def fetch_arp_file(domain: str) -> dict | None:
    url = f"https://{domain}/.well-known/reasoning.json"
    try:
        response = requests.get(url, timeout=5)
        response.raise_for_status()
        return response.json()
    except Exception:
        return None

Parsing the result into prioritized context is covered in the RAG Pipeline Integration guide.


Caching Strategy

ARP files should be cached. They change infrequently and refetching on every request wastes bandwidth and adds latency.

Recommended caching strategy:

  • Honor HTTP Cache-Control and Expires headers from the server
  • Set a minimum cache TTL of 1 hour even if the server sends shorter headers
  • Re-fetch when the verification.next_audit date has passed
  • Re-fetch when the cached file's signature fails verification (key rotation may have occurred)
  • Maximum cache TTL of 7 days before re-fetching regardless of headers

Store the cached content in your vector store or application cache keyed by domain. The domain field in the ARP file should always match the domain you fetched it from.