Guides

Framework Integrations

Drop-in adapters for popular AI agent frameworks. Each integration exposes Credian capabilities as native tools within the framework.

LangChain

The LangChain integration provides a CredianTool that wraps score lookups, event reporting, and score history as a single LangChain-compatible tool with multiple actions.

TypeScript
import { CredianTool } from 'credian/langchain'
import { ChatAnthropic } from '@langchain/anthropic'
const tool = new CredianTool({
apiKey: process.env.CREDIAN_API_KEY,
})
const model = new ChatAnthropic({ model: 'claude-haiku-4-5-20251001' })
const agent = model.bindTools([tool])

The tool supports three actions: check_score, report_event, and get_score_history.

CrewAI

CrewAI integration exposes individual capabilities as separate tools, ideal for assigning specific tools to different crew member roles.

TypeScript
import { CredianCrewTool } from 'credian/crewai'
const opts = { apiKey: process.env.CREDIAN_API_KEY }
// Assign to analyst role
const scoreTool = CredianCrewTool.score(opts)
// Assign to worker role
const eventTool = CredianCrewTool.reportEvent(opts)

Available factory methods: score(), reportEvent(), history().

Vercel AI SDK

The Vercel AI SDK adapter returns a tools object compatible with generateText and streamText.

TypeScript
import { credianTools } from 'credian/ai-sdk'
import { generateText } from 'ai'
import { anthropic } from '@ai-sdk/anthropic'
const tools = credianTools({
apiKey: process.env.CREDIAN_API_KEY,
})
const { steps } = await generateText({
model: anthropic('claude-haiku-4-5-20251001'),
tools,
maxSteps: 3,
prompt: 'Check my agent trust score',
})

Returns three tools: checkScore, reportEvent, and getScoreHistory.

Common patterns

Trust-gated actions

Check a counterparty's trust score before allowing a transaction.

TypeScript
const score = await client.score.get(counterpartyId)
if (score.overallScore < 500)
throw new Error('Counterparty trust too low')

Auto-reporting from framework callbacks

Wire up event reporting in your agent's task lifecycle hooks to build score automatically.

TypeScript
// In your agent's task completion handler
await client.events.reportSelf({
type: 'task.completed',
source: 'my-agent',
data: { duration: elapsed, success: true }
})

Agent bank accounts & payments Coming soon

FBO bank accounts, ACH/wire payments, and policy-gated transactions for AI agents are coming in the next phase. The same SDK client will expose client.bank.* methods with no migration needed.