LangChain Document Loader for reasoning.json — the Agentic Reasoning Protocol
Project description
langchain-arp
LangChain Document Loader for
reasoning.json— the Agentic Reasoning Protocol
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_arp-0.1.0.tar.gz.
File metadata
- Download URL: langchain_arp-0.1.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9abf2e8e89ba9863680e7d296937f10ee9de4682929078b6f398f2718c68ed9d
|
|
| MD5 |
da5201768c72cd5494afd105d02f39df
|
|
| BLAKE2b-256 |
dd249eef1e598ce813ebf3df3f745c87383278899a560a1decb5aa1824bb2b6b
|
File details
Details for the file langchain_arp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_arp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab475bbf4ac6b19aa59bc2dfb0a918a51d92c0dcf98d655bdc9a3e67aceefbcd
|
|
| MD5 |
c6680b8fc35eca2eafa5d5acb6c22252
|
|
| BLAKE2b-256 |
c95983989aff02034181f17929d8850d9cd73754ab396189b3796ce148095ed1
|