Getting Started

Introduction

Last updated by
Harlan Wilton
in chore: sync.

What is Nuxt Ask AI?

Nuxt Ask AI is a Nuxt module that makes your website discoverable and searchable by AI agents and LLMs through standardized APIs and protocols. It enables content creators to make their sites accessible to the growing ecosystem of AI-powered tools and assistants.

The module uses build-time vector indexing with runtime semantic search via vector databases.

Why Nuxt Ask AI?

As AI agents become more prevalent, websites need a standardized way to expose their content for discovery and retrieval. Nuxt Ask AI solves this by:

  1. Build-time Processing: Heavy operations (content extraction, chunking, embedding generation) happen during prerender
  2. Vector Database Storage: All embeddings stored in SQLite/PostgreSQL/Cloudflare Vectorize for efficient similarity search
  3. Flexible Deployment: Support multiple vector DB providers (sqlite-vec, libsql, pgvector, Cloudflare Vectorize, Upstash)
  4. Standard Protocols: Implement industry standards (MCP, llms.txt)
  5. RAG Support: Built-in retrieval-augmented generation for AI chat

Key Features

Semantic Search & RAG

  • Vector similarity search - understand meaning, not just keywords
  • AI chat with RAG - conversational AI with streaming responses
  • Multiple embedding providers via AI SDK - transformers.js, OpenAI, Google, Mistral, Cohere, Anthropic, Ollama, Workers AI
  • Dual-provider architecture - different providers for build-time vs runtime (e.g., local build, cloud runtime)

Model Context Protocol (MCP)

Enable AI agents like Claude to directly read and search your site through the standardized Model Context Protocol:

  • List all available pages as resources
  • Read specific page content
  • Search your site using tools
  • Access pre-defined prompts

AI Discovery APIs

Standardized endpoints for AI agent integration:

  • /api/search - Semantic search endpoint
  • /api/chat - AI SDK compatible chat with RAG
  • /llms.txt - AI-readable site overview and API docs

Markdown for LLMs

Automatically serve markdown versions of your pages through @mdream/nuxt integration:

  • Accept header-based content negotiation
  • .md postfix support for any page
  • llms.txt and llms-full.txt generation

How It Works

Build Time

  1. Content Extraction: During prerender, HTML content is extracted and converted to markdown via mdream
  2. Chunking: Content is split into chunks using mdream's splitter
  3. Embeddings: Generate embeddings for all chunks via AI SDK (configurable provider)
  4. Vector Storage: Upsert vectors to vector database (sqlite-vec, libsql, pgvector, etc)
  5. File Writing: Output bulk JSONL and debug chunks

Runtime

  1. Search API: Vector similarity search for semantic queries
  2. Chat API: RAG with LLM streaming via AI SDK (supports conversational context)
  3. Query Rewriting: Optional LLM-powered query expansion for better search results
  4. Hook System: Customize behavior via Nitro hooks (ai-search:search:query, ai-search:chat:context, etc)

Platform Support

Works seamlessly on any platform supported by Nitro:

  • Node.js (≥22.5 for sqlite-vec, ≥18 for libsql)
  • Cloudflare Workers & Pages (with Vectorize + Workers AI)
  • Vercel, Netlify, Azure, AWS
  • Turso (libsql remote)
  • PostgreSQL (with pgvector extension)
  • Upstash Vector (serverless)

Vector Database Options

  • sqlite-vec: Local SQLite with vec0 extension (Node.js ≥22.5)
  • libsql: SQLite fork with native F32_BLOB vectors (local or remote via Turso)
  • pgvector: PostgreSQL extension with HNSW index
  • Cloudflare Vectorize: Serverless vector storage (build + runtime)
  • Upstash Vector: Text-native serverless vector DB (no pre-embedding needed)

Next Steps

Ready to get started? Follow the installation guide to add Nuxt Ask AI to your project.

Did this page help you?