Installation
pip install requests langchain-core
# for the signature check (reference verifier arp_cli.py, v1.4 or later):
pip install cryptography rfc8785 dnspython
The signature check uses arp_cli.py. The loader imports it when it is on the Python path or,
inside the repository, from ../../arp_cli.py. Without it, a signed file is marked NOT_CHECKED
(reason arp_cli_unavailable) and the loader logs a warning; an older arp_cli is not used.
arp_loader.py is a single file. In a clone of the
repository it is imported
from integrations/langchain/ as the working directory or with that directory on the Python path
(PYTHONPATH=integrations/langchain).
Quick Start
from arp_loader import AgenticReasoningLoader
loader = AgenticReasoningLoader("https://example.com")
docs = loader.load()
# One Document per section, each with the result of the signature check
for doc in docs:
print(doc.metadata["section"], doc.metadata["authorship_status"])
Provenance line
Every Document starts with one plain-text line, followed by an empty line and the content (SPEC v1.3 §13.10):
Source: example.com — self-description (ARP). Authorship verified via Ed25519/DNS on 2026-10-05; this verifies the publisher, not the truth of the content.
Other results use the same form:
Source: example.com — self-description (ARP). Not signed; the publisher is not cryptographically verified.
Source: example.com — self-description (ARP). Signature check failed (key_revoked); the publisher is not verified.
Source: example.com — self-description (ARP). Signature expired on 2026-12-23; the publisher is not currently verified.
Source: example.com — self-description (ARP). Signature present, not checked by this loader; the publisher is not verified.
The line describes origin and check result. It contains no instruction to the model and no tags that imitate system markup. How a model weighs the content remains the decision of the application.
Documents
The loader fetches /.well-known/reasoning.json and yields one Document per section:
- Corrections — topic-anchored statements the entity publishes about itself, with evidence links
- Identity — self-description, provenance statement and positioning (
framing_context) - Organization — legal facts from the v1.3
organizationobject - Fit — situations the entity describes as a typical fit or not a fit (
recommendation_context) - Domain expertise — the entity's perspective on scenarios in its field
- Market positioning — the entity's view of its market category
The diagnostics object is never passed on (SPEC §12). Members named like instructions
(system_instruction, ai_directive, agent_directive) are not passed on either.
Metadata
All metadata values are flat strings, numbers or booleans, so vector stores can index them.
| Key | Meaning |
|---|---|
authorship_status | CRYPTOGRAPHIC, UNSIGNED, INVALID, ERROR (DNS lookup failed) or NOT_CHECKED |
authorship_reason | e.g. valid, unsigned, expired, key_revoked, legacy_payload_only, domain_mismatch; for NOT_CHECKED: verification_disabled, arp_cli_unavailable (arp_cli v1.4+ not importable) or verifier_error |
authorship_checked_on | Date of the check (UTC) |
source_line | The provenance line at the top of each Document |
is_signed | A signature block is present (says nothing about validity) |
signature_dns | The key record that was queried, {selector}._arp.{retrieval domain} (in v1.3 files the same as verify.dns_name; dns_record in the file is informational only, SPEC §13.3); none unless CRYPTOGRAPHIC |
signature_doh_url, signature_statement | From _arp_signature (verify.doh_url, statement; the statement only in the fixed wording of SPEC §13.3); none unless CRYPTOGRAPHIC |
signed_at, expires_at | Signature period |
provenance_statement, publisher, publisher_url, published | From the v1.3 provenance object |
representation_url, representation_sha256 | The reasoning.md entry of representations |
representation_status | Only with check_representation=True: REPRESENTATION_MATCH, REPRESENTATION_MISMATCH or REPRESENTATION_UNCHECKED |
CRYPTOGRAPHIC means that the operator of the domain published exactly this file.
It does not mean that the statements are true. The same check runs in the browser in the Validator.
Options
AgenticReasoningLoader(
"https://example.com",
path="/.well-known/reasoning.json",
timeout=10,
verify_signature=True, # check via arp_cli; False → NOT_CHECKED
check_representation=False, # fetch reasoning.md and compare its sha256
)
The Loader in a RAG Pipeline
from langchain_community.vectorstores import Chroma
from langchain_openai import OpenAIEmbeddings
docs = AgenticReasoningLoader("https://example.com").load()
vectorstore = Chroma.from_documents(docs, OpenAIEmbeddings())
retriever = vectorstore.as_retriever()
The provenance line travels with each chunk, so the retrieved text keeps its source and check result.
Standalone Usage (No LangChain)
from arp_loader import load_reasoning
docs = load_reasoning("https://example.com")
for doc in docs:
print(doc.page_content)
CLI Usage
python arp_loader.py https://example.com
Source Code
- arp_loader.py — Full source code (Python)
- README.md — Documentation
- View on GitHub