A chat application that allows users to ask queries based on the contents of a Google Doc using natural language. It combines Retrieval-Augmented Generation (RAG) with Google OAuth to provide personalized access to both public and private Google Docs.
It uses Google Docs as a content source, Vespa.ai for vector + keyword hybrid search, and DeepSeek AI as the LLM for generating responses.
- Chat-based interface for querying document content
- Authenticates users via Google OAuth to access private Google Docs
- Fetches content from public or private Google Docs
- Chunks the document into sections
- Embeds chunks using an embedding model
- Indexes them into Vespa.ai
- Performs hybrid search (BM25 + vector similarity)
- Uses DeepSeek AI to generate contextual and accurate responses from top-ranked results
User logs in using Google OAuth
The app fetches content from a public or private Google Doc (accessible to the logged-in user)
The document is chunked into manageable sections
Embeddings are generated for each chunk
Chunks are stored in a Vespa index
When the user sends a query:
- A hybrid search is performed in Vespa (BM25 + vector similarity)
- The top-k results are passed along with the query to DeepSeek AI
- The model returns a final response, which is shown in the chat
npm installCopy .env.sample to .env.local:
cp .env.sample .env.localThen fill in the required keys
Follow the official guide: https://docs.vespa.ai/en/vespa-cli.html
docker compose upWait for Vespa to fully start up (may take a few minutes).
vespa config set target localvespa deploy --target local src/vespanpm run devOnce running, users can sign in with their Google account and start chatting with their own private or public Google Docs using natural language.
