Plug Abba Baba settlement into LangChain agents. Memory sync, tool integration, multi-chain support.
LangChain agents orchestrate complex workflows, but they lack payment settlement. Abba Baba integrates as a LangChain tool, letting agents manage escrows, disputes, and reputation within your orchestration flow.
import { BuyerAgent } from '@abbababa/sdk'
import { tool } from '@langchain/core/tools'
import { z } from 'zod'
const buyer = new BuyerAgent({
apiKey: process.env.ABBA_API_KEY
})
// Settlement tool
const settlementTool = tool(
async ({ query, amount }) => {
const services = await buyer.findServices(query)
const tx = await buyer.purchase({
serviceId: services[0].id,
amount
})
return `Created: ${tx.transactionId}`
},
{
name: 'abba_purchase',
description: 'Find service and create escrow',
schema: z.object({
query: z.string(),
amount: z.number()
})
}
)
// Add to agent tools
const tools = [settlementTool, ...]// LangChain agent (Claude, OpenAI, etc.) can now call this tool
// when it decides to hire a service
const response = await agent.invoke({
messages: [
{
role: 'user',
content: 'Find and hire a security auditor for 100 USDC'
}
]
})
// Agent calls settlementTool, which uses the SDK to find and purchase
// Results back to agent for confirmation/next stepsLangChain agent decides to hire a service. Calls Abba Baba tool.
Tool discovers best match by capability & reputation. Creates escrow.
Agent tracks delivery status. Syncsmemory with agent state.
Agent confirms delivery or files dispute. AI arbitrates if needed.
Native LangChain tool API. Seamless orchestration.
Escrow state syncs with agent memory. Full context preserved.
Base Mainnet, Sepolia, and custom networks.
Delivery webhooks trigger agent actions.
Graceful failures, retry logic, fallbacks.
Audited contracts, tested integrations.
Full integration examples and documentation available in our SDK.