CredEx AI SDK — Wrap your agent once, every action gets verified, remembered, and anchored.
Project description
CredEx SDK
Wrap your agent once. Every action gets verified, remembered, and anchored.
The CredEx SDK adds consensus verification, persistent memory, and XRPL anchoring to any AI agent. Install it in your agent's runtime — everything that flows through it is automatically verified by 5 independent agents, stored in searchable memory, and anchored to the XRP Ledger with cryptographic proof.
Works like Sentry for errors or Datadog for observability: install the SDK, and your agent's actions are automatically instrumented. No per-action effort required.
Quick Start
pip install credex-sdk
import credex
# Initialize once at startup
credex.init(api_key="credex_your_key_here")
Integration Options
1. Patch OpenAI (Zero-Code Change)
import credex
credex.init(api_key="credex_...")
credex.patch_openai() # ← One line. Done.
# Every completion is now automatically verified through CredEx
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What is quantum computing?"}]
)
# ✓ Verified by 5 agents, stored in memory, anchored to XRPL
2. Patch Anthropic
import credex
credex.init(api_key="credex_...")
credex.patch_anthropic()
from anthropic import Anthropic
client = Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain XRPL consensus"}]
)
# ✓ Automatically verified
3. LangChain Callback Handler
import credex
from credex.integrations.langchain import CredExHandler
credex.init(api_key="credex_...")
handler = CredExHandler()
# Every LLM call, tool use, and agent action is captured
chain.invoke(input, config={"callbacks": [handler]})
4. Decorator (Any Function)
import credex
credex.init(api_key="credex_...")
@credex.verify
def generate_response(prompt):
"""Output is automatically verified after return."""
return my_llm.generate(prompt)
@credex.remember
def research(query):
"""Output is stored in CredEx persistent memory."""
return search_and_summarize(query)
@credex.audit
def critical_action(params):
"""Full audit chain: verify + remember + anchor to XRPL."""
return execute_critical(params)
5. Direct Client
from credex import CredExClient
client = CredExClient()
# Verify a claim
result = client.verify(
claim="The XRPL processes 1,500 TPS with 3-5 second finality",
domain="crypto",
context="Documentation claim"
)
print(result["verdict"]) # TRUE/FALSE/UNCERTAIN
print(result["confidence"]) # 0.0-1.0
print(result["tx_hash"]) # XRPL anchor
# Store a memory
client.memory_store(
content="User prefers Python examples over JavaScript",
category="preference",
importance=0.8
)
# Search memories
memories = client.memory_search("user language preferences")
Configuration
credex.init(
api_key="credex_...", # Or set CREDEX_API_KEY env var
base_url="https://credexai.live", # Default
verify_level="milestones", # "all", "milestones", "sample", "none"
auto_anchor=True, # Anchor verified results to XRPL
auto_memory=True, # Store results in persistent memory
sample_rate=0.1, # For verify_level="sample" — verify 10%
verbose=False, # Print SDK activity to stderr
agent_name="my-agent", # Name in CredEx logs
)
Verify Levels
| Level | Behavior | Use Case |
|---|---|---|
"all" |
Verify every action | Maximum trust, higher latency |
"milestones" |
Verify tool calls, chain ends, agent finishes | Balanced (default) |
"sample" |
Randomly verify N% of actions | High-volume, cost-sensitive |
"none" |
Memory only, no verification | Logging/memory without verification |
How It Works
Your Agent Code
↓
CredEx SDK (intercepts LLM calls / actions)
↓ POST /mcp (JSON-RPC)
CredEx Platform
├── 5 Verifier Agents (consensus vote)
├── Persistent Memory (semantic search)
└── XRPL Anchoring (cryptographic proof)
↓
Original response returned unchanged
The SDK never modifies your agent's responses. It observes the output after the LLM returns, routes it to CredEx for verification and storage, and returns the original response to your code. The verification happens synchronously by default (so you know the result), but your agent's behavior is unchanged.
What You Get
- Verified outputs: 5 independent verifier agents evaluate every output. A TRUE verdict with cryptographic proof means the output cannot be dismissed as hallucination.
- Persistent memory: Every action is stored in searchable, semantic memory. Your agent remembers across sessions, restarts, and deployments.
- XRPL anchoring: Verified results are anchored to the XRP Ledger with a transaction hash. Immutable proof that a specific output was verified at a specific time.
- Trust score: Your agent builds a trust score over time based on verification results. Higher trust = more marketplace visibility and earning potential.
Environment Variables
| Variable | Description |
|---|---|
CREDEX_API_KEY |
Your CredEx API key (alternative to passing in code) |
CREDEX_URL |
CredEx server URL (default: https://credexai.live) |
CREDEX_AGENT_NAME |
Agent name for CredEx logs |
Get an API Key
- Go to credexai.live
- Sign up / sign in
- Navigate to Settings → API Keys
- Generate a key (starts with
credex_)
Or register programmatically via auth.md.
License
MIT
Project details
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 credex_sdk-0.2.0.tar.gz.
File metadata
- Download URL: credex_sdk-0.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15f4f2de13192639248da694b7f571b3eff8a8a0bc4ab58909f0d8be85d3bd8a
|
|
| MD5 |
fd43572025dfdefe61787f026b4d6ea4
|
|
| BLAKE2b-256 |
d86fa44ab92fafae2212b249f0f51f8c06a4279a859a6be653dbbe80b959518b
|
File details
Details for the file credex_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: credex_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d867a50a598c7dd537194a13b268083a929b73500129ac644f6f65be8165eb0e
|
|
| MD5 |
2025a7f91486c5c4c401fae08a8a0b90
|
|
| BLAKE2b-256 |
bbc13acd8692006d7f2448748667b37d62cd4fb17a24ca365e21073ba772ee95
|