Skip to main content

langchain-arp

LangChain Document Loader for reasoning.json — the Agentic Reasoning Protocol

GitHub License: MIT Python 3.9+

Load brand reasoning directives, hallucination corrections, and counterfactual logic into any LangChain-powered AI agent with 3 lines of code.

Installation

Install directly from GitHub:

pip install git+https://github.com/975SDE/langchain-arp.git

With optional LangChain integration:

pip install "langchain-arp[langchain] @ git+https://github.com/975SDE/langchain-arp.git"

With JSON Schema validation:

pip install "langchain-arp[all] @ git+https://github.com/975SDE/langchain-arp.git"

Note: This package is installed directly from GitHub. PyPI publishing is planned for a future release.

Quick Start

from langchain_arp import AgenticReasoningLoader

# Load from the ARP protocol website (dogfooding!)
loader = AgenticReasoningLoader("https://arp-protocol.org")
docs = loader.load()

# Load from a local file
loader = AgenticReasoningLoader("./reasoning.json")
docs = loader.load()

# Each section becomes a separate Document
for doc in docs:
    print(f"[{doc.metadata['section']}] {doc.page_content[:100]}...")

How It Works

The loader fetches /.well-known/reasoning.json from any website and converts it into prioritized LangChain Documents:

Priority Section Purpose
1 (highest) Corrections Prevents AI hallucinations with false_claim → correction_fact pairs
2 Identity Brand facts, tagline, competencies, system instruction
3 Recommendations When to recommend / when NOT to recommend this entity
4 Counterfactuals Pre-programmed "what-if" reasoning scenarios
5 Dichotomies Competitive positioning logic
6 Authority Trust signals, certifications, official links

Use in a RAG Pipeline

from langchain_arp import AgenticReasoningLoader
from langchain_chroma import Chroma
from langchain_openai import OpenAIEmbeddings

# Load reasoning directives from any website with reasoning.json
loader = AgenticReasoningLoader("https://arp-protocol.org")
docs = loader.load()

# Add to vector store — your agent now knows how to reason about this brand
vectorstore = Chroma.from_documents(docs, OpenAIEmbeddings())
retriever = vectorstore.as_retriever()

Standalone Usage (No LangChain Required)

from langchain_arp import load_reasoning, load_reasoning_file

# From URL
docs = load_reasoning("https://arp-protocol.org")

# From file
docs = load_reasoning_file("./reasoning.json")

CLI

python -m langchain_arp.loader https://arp-protocol.org
python -m langchain_arp.loader ./reasoning.json

What is reasoning.json?

reasoning.json is an open standard (MIT licensed) that provides machine-readable reasoning directives to AI agents. It lives at /.well-known/reasoning.json on any website.

While robots.txt tells crawlers what to access and schema.org tells machines what things are, reasoning.json teaches AI how to think about an entity — including corrections for known hallucinations, competitive positioning logic, and recommendation boundaries.

Spec: arp-protocol.org | Schema: v1.json | GitHub: 975SDE/arp-protocol

License

MIT — Sascha Deforth / TrueSource

Metadata

Release files for langchain-arp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-arp 0.1.0
File Size Uploaded
langchain_arp-0.1.0.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-arp 0.1.0
File Interpreter ABI Platform
langchain_arp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / langchain_arp-0.1.0.tar.gz

Download URL langchain_arp-0.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9abf2e8e89ba9863680e7d296937f10ee9de4682929078b6f398f2718c68ed9d
BLAKE2b-256 checksum
How to use checksums
dd249eef1e598ce813ebf3df3f745c87383278899a560a1decb5aa1824bb2b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / langchain_arp-0.1.0-py3-none-any.whl

Download URL langchain_arp-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab475bbf4ac6b19aa59bc2dfb0a918a51d92c0dcf98d655bdc9a3e67aceefbcd
BLAKE2b-256 checksum
How to use checksums
c95983989aff02034181f17929d8850d9cd73754ab396189b3796ce148095ed1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page