Installation
Terminal
pip install requests langchain
Quick Start
Python
from arp_loader import AgenticReasoningLoader
# Load from any website
loader = AgenticReasoningLoader("https://example.com")
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 domain
and splits it into prioritized Documents optimized for RAG retrieval:
- Corrections (highest priority) — prevents hallucinations during RAG
- Identity — brand facts and system instructions
- Recommendations — when to recommend / when not to
- Counterfactuals — pre-programmed reasoning logic
- Dichotomies — competitive positioning pivots
Each Document includes rich metadata (entity, section,
protocol, version) for targeted retrieval.
Use in a RAG Pipeline
Python — Vector Store Integration
from langchain.vectorstores import Chroma
from langchain.embeddings import OpenAIEmbeddings
# Load reasoning documents
loader = AgenticReasoningLoader("https://example.com")
docs = loader.load()
# Add to vector store
vectorstore = Chroma.from_documents(docs, OpenAIEmbeddings())
# Now your AI agent knows how to reason about this brand
retriever = vectorstore.as_retriever()
Standalone Usage (No LangChain)
Python
from arp_loader import load_reasoning
docs = load_reasoning("https://example.com")
for doc in docs:
print(doc.page_content)
CLI Usage
Terminal
python arp_loader.py https://example.com
Source Code
- arp_loader.py — Full source code (Python)
- README.md — Documentation
- View on GitHub