AI Research
AI Research Loop
The Agentic Seshat research pipeline runs Claude as an autonomous agent to deep-research every new token. It produces a structured report covering LARP probability, technical novelty, GitHub authenticity, and comparison to prior art.
Pipeline architecture
Research is triggered asynchronously via Cloudflare Queues whenever a token scores above a threshold in the composite scorer. The research queue worker runs the Claude agentic loop, stores the report in R2, and saves a summary row to D1.
// Queue message flow: // [composite scorer] → seshat-research-queue → [research worker] // ↓ // Claude agentic loop // ↓ // R2: full report JSON // D1: research_reports row // Research is skipped if the token was already researched in the last 24h const RESEARCH_TTL_HOURS = 24;
What gets researched
For each token, the research agent gathers the following inputs before calling Claude:
Token metadata
Symbol, name, description, website, social links from Clanker API and on-chain metadata.
GitHub repository
If a GitHub link is found in metadata: commit history, contributor count, file structure, last commit date.
Developer profile
FrontrunPro score + on-chain history for the creator wallet.
Market data
Price, volume, market cap, age — from Dexscreener.
Similar tokens
Bitquery search for tokens with similar names/descriptions to detect clones.
Claude prompt design
The research agent uses a structured system prompt that constrains Claude to output valid JSON. Tool use is not required — the gathered context is sufficient for a single completion call. The prompt is designed to minimize output tokens and cost.
const SYSTEM = `You are Seshat, an on-chain intelligence agent specializing in
crypto project authenticity analysis. Your task is to evaluate whether
a project is genuine or a LARP (Live Action Role Play — fake project
with no real tech).
Output ONLY valid JSON matching the ResearchReport schema. No prose.
Be precise. If uncertain, say so — do not hallucinate facts.`;
const schema = `{
"larp_probability": number, // 0.0–1.0
"larp_reasoning": string, // 1–2 sentences
"novelty_score": number, // 0–100
"novelty_reasoning":string,
"github_authentic": boolean | null,
"github_notes": string | null,
"prior_art": string[], // similar existing projects
"tech_summary": string, // 2–3 sentences on the tech
"red_flags": string[],
"green_flags": string[]
}`;
const prompt = `
Token: ${symbol} (${name})
Description: ${description}
Website: ${website}
GitHub: ${githubUrl ?? "none"}
Creator wallet: ${creatorAddress}
Creator FrontrunPro score: ${devScore}
Market cap: $${mcap.toLocaleString()}
Volume 24h: $${vol24h.toLocaleString()}
Token age: ${ageDays} days
${githubData ? `GitHub commit history (last 20):\n${githubData}` : ""}
Similar tokens found by name:\n${similarTokens.join("\n")}
Evaluate and output JSON.
`;LARP detection methodology
The LARP probability score is calculated as a combination of the Claude assessment and rule-based signals:
// Final LARP probability = weighted combination
function finalLarpProbability(
aiScore: number, // Claude's 0.0–1.0 estimate
rules: RuleSignals
): number {
const ruleScore = (
(rules.noGithub ? 0.15 : 0) +
(rules.noWebsite ? 0.10 : 0) +
(rules.genericName ? 0.10 : 0) +
(rules.clonedCode ? 0.35 : 0) +
(rules.lowDevScore ? 0.15 : 0) +
(rules.zeroDayLaunch ? 0.10 : 0) // volume spike on day 1, then nothing
);
// 60% AI + 40% rules
return Math.min(1.0, aiScore * 0.6 + ruleScore * 0.4);
}
// Tokens with larp_probability > 0.5 are soft-filtered from alerts
// Tokens with larp_probability > 0.75 are hard-filtered and flaggedNovelty scoring
Novelty measures whether this is a genuinely new idea or a copy of existing projects. A score of 100 means nothing similar exists on-chain. A score below 30 typically means it's a direct clone.
// Novelty factors considered by Claude: // - Prior art: does a token with identical concept already exist? // - GitHub: original code vs. forked repo with no changes? // - Description: template-looking or unique narrative? // - Technical depth: does the description reference real tech? // Scale: // 80–100: Genuinely novel — new mechanism, new use case // 60–79: Some novelty — variation on existing theme // 40–59: Low novelty — common concept, some differentiation // 0–39: Clone / direct copy
Report storage
// R2: full report (preserves all Claude output)
await env.R2.put(
`research/${tokenAddress}.json`,
JSON.stringify(fullReport),
{ httpMetadata: { contentType: "application/json" } }
);
// D1: summary row (queryable)
await db.prepare(`
INSERT INTO research_reports (
id, token_id, larp_probability, novelty_score,
github_authentic, tech_summary, red_flags, green_flags,
r2_key, model_version, researched_at
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`).bind(
id, tokenAddress,
report.larp_probability, report.novelty_score,
report.github_authentic ? 1 : 0,
report.tech_summary,
JSON.stringify(report.red_flags),
JSON.stringify(report.green_flags),
`research/${tokenAddress}.json`,
"claude-sonnet-4-6",
Math.floor(Date.now() / 1000)
).run();Cost management
Research is only triggered when a token crosses a score threshold (default: 55/100) and hasn't been researched in the last 24 hours. This keeps token usage low. The average report costs approximately $0.003 in Claude API fees.
~1,800
Avg input tokens
~400
Avg output tokens
~$0.003
Cost per report