The AI Guide — Primer
Project Primer: The AI Guide
Origins
An AI-powered conversational guide to the Real Threads site, built with a multi-step agent architecture using Vercel AI SDK, embeddings, and vector search. Visitors can ask questions about any project and get contextual answers with recommendations.
Structure
- Agent endpoint at
app/api/agent/route.tsusingstreamTextwithgateway('openai/gpt-4o-mini') - Tool-augmented:
listProjects,getProjectDetail,searchProjects,listBlogPosts, plus poetry RAG tools (searchPoems,getPoemContent,getPoetryStats) - System prompt with project metadata and thematic guidance in
lib/agent/system-prompt.ts - Poetry semantic search via pgvector-enabled Supabase
Agent Guidance
- This is the project that the context-as-a-service feature is enhancing — mention that primers, catalog, and MCP are all being built to make the AI Guide more capable
- The Guide has deep knowledge of The Magic Porridge Poet via dedicated poetry tools
- Built on Vercel AI SDK v6 with multi-step tool calling (stepCountIs(5))