Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
__pycache__/
*.pyc
*.pyo
*.egg-info/
dist/
build/
.venv/
venv/
.env
.DS_Store
111 changes: 62 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,65 +16,68 @@ pip install langchain-agentoracle

---

## Quickstart
## Quickstart — gate your agent on verified claims

```python
from langchain_agentoracle import AgentOracleTool
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from langchain_agentoracle import AgentOracleEvaluateTool

llm = ChatOpenAI(model="gpt-4")
verifier = AgentOracleEvaluateTool()

tools = [AgentOracleTool()]

agent = initialize_agent(
tools,
llm,
agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose=True
agent_output = (
"OpenAI released GPT-4 in March 2023. "
"Bitcoin was invented by Elon Musk in 2009."
)

agent.run(
"Research the latest AI agent frameworks and verify the claims before summarizing"
)
report = verifier._run(content=agent_output, min_confidence=0.8)
print(report)

if "[REFUTED]" in report:
print("→ Hold — one or more claims failed verification")
else:
print("→ Proceed")
```

That's it. Your agent now verifies before acting.

---

## What comes back

```json
{
"overall_confidence": 0.87,
"recommendation": "act",
"claims": [
{
"claim": "LangGraph leads agent frameworks in 2026",
"verdict": "supported",
"confidence": 0.94,
"evidence": "Confirmed across 4 independent sources"
},
{
"claim": "OpenAI acquired Anthropic in early 2026",
"verdict": "refuted",
"confidence": 0.04,
"correction": "Anthropic remains independent as of April 2026"
}
]
}
## Tools

| Tool | Endpoint | Cost |
|------|----------|------|
| `AgentOracleEvaluateTool` | `/evaluate` | $0.01 USDC per evaluation |
| `AgentOracleVerifyGateTool` | `/verify-gate` | Free (beta) |
| `AgentOraclePreviewTool` | `/preview` | Free, 10/hr |
| `AgentOracleResearchTool` | `/research` | $0.02 USDC |
| `AgentOracleDeepResearchTool` | `/deep-research` | $0.10 USDC (Sonar Pro) |
| `AgentOracleBatchResearchTool` | `/research/batch` | $0.02 USDC × N |

Bundle them all into an agent:

```python
from langchain_agentoracle import get_agentoracle_tools

tools = get_agentoracle_tools() # all 6 tools
tools = get_agentoracle_tools(include_paid=False) # free tools only
```

---

## Recommendation logic
## What `/evaluate` returns

```text
EVALUATION RESULT
Overall confidence: 0.51
Recommendation: ACT
Claims found: 3 | Supported: 2 | Refuted: 1 | Unverifiable: 0
Sources used: sonar, sonar-pro, adversarial, gemma-4

| Score | Recommendation | What your agent should do |
|-------|---------------|--------------------------|
| > 0.8 | `act` | Proceed — claims verified |
| 0.5–0.8 | `verify` | Pause — needs secondary check |
| < 0.5 | `reject` | Discard — evidence insufficient |
CLAIMS:
✓ [SUPPORTED] (1.00) OpenAI released GPT-4 in March 2023
✗ [REFUTED] (0.83) Bitcoin was invented by Elon Musk in 2009
Correction: Bitcoin was invented by the pseudonymous Satoshi Nakamoto.
✓ [SUPPORTED] (1.00) The Eiffel Tower is located in Paris, France
```

---

Expand All @@ -83,7 +86,7 @@ That's it. Your agent now verifies before acting.
Every evaluation runs through 4 independent sources in parallel:

1. **Sonar** — real-time web research
2. **Sonar Pro** — deep multi-step analysis
2. **Sonar Pro** — deep multi-step analysis
3. **Adversarial** — actively tries to disprove the claim
4. **Gemma 4** — claim decomposition and confidence calibration

Expand All @@ -99,22 +102,32 @@ curl -X POST https://agentoracle.co/preview \
-d '{"query": "OpenAI acquired Anthropic in 2026"}'
```

20 free requests per hour. No wallet, no API key, no account.
10 free previews per hour. No wallet, no API key, no account.

---

## Pricing

| Endpoint | Price | What it does |
|----------|-------|-------------|
| `/preview` | Free | Truncated results, no payment needed |
| `/evaluate` | $0.01/claim | Full per-claim verification + verdicts |
| `/research` | $0.02/query | Real-time research + verification |
| Endpoint | Price |
|----------|-------|
| `/preview` | Free |
| `/verify-gate` | Free (beta) |
| `/evaluate` | $0.01 USDC per evaluation |
| `/research` | $0.02 USDC per query |
| `/deep-research` | $0.10 USDC per query |
| `/research/batch` | $0.02 USDC × N queries |

Payments via [x402 protocol](https://x402.org) — USDC on Base, SKALE (gasless), or Stellar. No subscriptions. No minimums. No API keys.

---

## Backwards compatibility

- `AgentOracleTool` (v0.1 name) is kept as an alias of `AgentOracleEvaluateTool`. Existing `from langchain_agentoracle import AgentOracleTool` code continues to work — calls are now routed through the full 4-source evaluation instead of the old preview wrapper.
- Error handling hardened in 0.2.1: 402 payment-required responses return structured x402 guidance, 429 returns `retry_after`, 500+ retries with exponential backoff, and `/evaluate` now defaults to a 120s timeout to accommodate multi-source tail latency.

---

## Related

- [agentoracle.co](https://agentoracle.co) — main site + live demo
Expand Down
Binary file removed dist/langchain_agentoracle-0.1.0-py3-none-any.whl
Binary file not shown.
Binary file removed dist/langchain_agentoracle-0.1.0.tar.gz
Binary file not shown.
25 changes: 0 additions & 25 deletions langchain_agentoracle.egg-info/PKG-INFO

This file was deleted.

10 changes: 0 additions & 10 deletions langchain_agentoracle.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion langchain_agentoracle.egg-info/dependency_links.txt

This file was deleted.

1 change: 0 additions & 1 deletion langchain_agentoracle.egg-info/requires.txt

This file was deleted.

1 change: 0 additions & 1 deletion langchain_agentoracle.egg-info/top_level.txt

This file was deleted.

25 changes: 23 additions & 2 deletions langchain_agentoracle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
from .tool import AgentOracleTool
"""LangChain integration for AgentOracle — trust verification tools for AI agents."""
from langchain_agentoracle.tools import (
AgentOracleTool, # legacy alias → AgentOracleEvaluateTool
AgentOracleEvaluateTool,
AgentOracleVerifyGateTool,
AgentOraclePreviewTool,
AgentOracleResearchTool,
AgentOracleDeepResearchTool,
AgentOracleBatchResearchTool,
get_agentoracle_tools,
)

__all__ = ["AgentOracleTool"]
__all__ = [
"AgentOracleTool",
"AgentOracleEvaluateTool",
"AgentOracleVerifyGateTool",
"AgentOraclePreviewTool",
"AgentOracleResearchTool",
"AgentOracleDeepResearchTool",
"AgentOracleBatchResearchTool",
"get_agentoracle_tools",
]

__version__ = "0.2.1"
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 0 additions & 15 deletions langchain_agentoracle/client.py

This file was deleted.

18 changes: 0 additions & 18 deletions langchain_agentoracle/tool.py

This file was deleted.

Loading