import type { Metadata } from 'next'; import { getRouter } from '@rareindex/ai'; import { ResearchClient } from '@/components/research/research-client'; import { SUGGESTED_PROMPTS } from '@/lib/ai/research'; import { getDb, sql } from '@rareindex/database'; export const metadata: Metadata = { title: 'AI Research — ask questions over structured collectibles market data', description: 'Conversational research over RareIndex data: assets, sales, listings, indices, movers and screens. Every answer is grounded in tool queries you can inspect.', }; export const dynamic = 'force-dynamic'; export default async function ResearchPage({ searchParams }: { searchParams: Promise<{ asset?: string; q?: string }> }) { const sp = await searchParams; const router = getRouter(); let prefill = sp.q ?? ''; if (sp.asset && !prefill) { const [a] = (await getDb().execute(sql`select title from assets where slug = ${sp.asset} limit 1`)) as unknown as Array<{ title: string }>; prefill = a ? `Give me a market brief on ${a.title} (/asset/${sp.asset}): valuation with confidence, recent sales, listings vs RIV, and 30d/1y change.` : ''; } return (
AI Research
Questions are answered only from RareIndex’s structured data through inspectable queries. When the data is not there, the answer says so.