1 · Prerequisites
All steps below assume the canonical nextjs‑ai‑chatbot code base. If you started from scratch, follow Vercel’s Quickstart first, then return here.2 · Install the Tako SDK
3 · Add a searchTakoKnowledge tool
Add lib/ai/tools/tako.ts
Add lib/ai/tools/tako.ts
4 · Wire the tool into the Edge Route
Openapp/(chat)/api/chat/route.ts
and make three small edits:
-
Add the import at the top
-
Register the executor in the
tools
map:
5 · Render Knowledge Cards in the Chat UI
Insidecomponents/message.tsx
, extend the preview switch so it recognises the new tool:
Inside components/message.tsx, extend the preview
Inside components/message.tsx, extend the preview
knowledge_cards
array to a deck of responsive <TakoCard>
components.
With this in place, every time the model invokes searchTakoKnowledge
, the returned array of cards is rendered as a deck of responsive iframes.
6 · Create the TakoCard component
Add components/tako-card.tsx
Add components/tako-card.tsx
7 · Deploy
TAKO_API_KEY
is added to the Vercel Project’s Environment Variables (Production + Preview).