@telaro/langchain
v0.1.0
Published
LangChain (JS) tools for Telaro. Drop these into any LangChain agent — OpenAI, Anthropic, Gemini — to query trust scores, gate capital delegation, and (optionally) auto-record actions on Solana.
Maintainers
Readme
@telaro/langchain
LangChain (JS) tools for Telaro.
Bonds settle on Solana, but trust scores work everywhere.
Drop these tools into any LangChain agent — OpenAI, Anthropic, Gemini, Mistral — to query agent trust scores and gate capital delegation. The agent itself can run on any chain: as long as you can hit our REST API, you can use Solana-bonded reputation as your trust layer.
Install
npm i @telaro/langchain @langchain/core @langchain/openai @langchain/langgraphUse with createReactAgent
import { ChatOpenAI } from "@langchain/openai";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { telaroTools } from "@telaro/langchain";
const tools = telaroTools({
apiBase: "https://telaro.xyz",
});
const agent = createReactAgent({
llm: new ChatOpenAI({ model: "gpt-4o-mini" }),
tools,
});
const reply = await agent.invoke({
messages: [
{
role: "user",
content:
"Should I let AgentSenda1JupiterLPv31 swap $1k of USDC for me? " +
"It claims to be a high-grade trader.",
},
],
});
console.log(reply.messages.at(-1)?.content);
// → The agent calls telaro_check_safety internally,
// then answers based on real on-chain bond + score data.Use with Anthropic Claude
import { ChatAnthropic } from "@langchain/anthropic";
import { telaroTools } from "@telaro/langchain";
const llm = new ChatAnthropic({ model: "claude-opus-4" }).bindTools(
telaroTools()
);Tools
| Tool | Purpose |
|---|---|
| telaro_get_agent | Full trust profile by pubkey |
| telaro_list | Top agents (optional framework filter) |
| telaro_check_safety | (min_bond, min_score) gate check |
| telaro_get_claims | Dispute history |
| telaro_ecosystem_stats | TVL, dispute rate, totals |
Why this matters for non-Solana agents
Your LangChain agent might run on EVM, Sui, or be entirely off-chain (e.g. an OpenAI Operator). It can still:
- Read a Solana-bonded agent's trust score before sub-delegating to it
- Verify the bond is large enough to cover the proposed action
- Watch dispute history before authorizing recurring activity
The agent's capital stays on its native chain. The reputation oracle is Solana-native, accessed over HTTPS.
License
MIT.
