Overview
Uxie’s AI Chat lets you have intelligent conversations about your PDF documents. Powered by Google’s Gemini 2.5 Flash, it uses Retrieval-Augmented Generation (RAG) to answer questions accurately based on your document’s actual content.Key Features
Document-Aware AI
AI answers based on your actual PDF content, not general knowledge
Context Search
Automatically finds relevant sections to answer your questions
Persistent History
All conversations are saved and accessible anytime
Quick Actions
Explain or summarize text directly from PDF selections
Getting Started
Activating AI Chat
Before you can use AI Chat, your document must be vectorized:Vectorization converts your PDF into a searchable format that enables AI to find relevant information quickly. This is a one-time process per document.
What Vectorization Does
Technical Details
Technical Details
- Extracts text from your PDF
- Splits content into chunks (1000 characters with 200-character overlap)
- Creates embeddings using AI models
- Stores vectors in Pinecone database
- Enables semantic search across your document
/src/lib/vectorise.tsUsing AI Chat
Asking Questions
Example Questions
Great questions to ask:- “What are the key findings in this research?”
- “Summarize the methodology section”
- “What evidence supports the main argument?”
- “Explain the concept of [topic] from this paper”
- “What are the limitations mentioned?”
- “Compare the approaches in sections 2 and 4”
Quick Actions from PDF
Explain Selected Text
Perfect for understanding complex passages, technical terms, or dense paragraphs.
Summarize Selected Text
Ideal for long sections, detailed descriptions, or extracting main points.
Chat Interface
Message Types
Your messages:- Appear on the right side
- Blue background
- Show your questions and prompts
- Appear on the left side
- Gray background
- Support markdown formatting (bold, lists, code, etc.)
- May include “Reading the document…” indicator while searching
Message Controls
Stopping Generation
Stopping Generation
While AI is generating a response:
- Click the stop button (ban icon)
- Or press Escape
- The AI stops immediately
Message History
Message History
- All messages are automatically saved
- Scroll up to view previous conversations
- History persists across sessions
- Reload the page to see all past messages
Chat Limitations
- Maximum message length: 1000 characters
- Maximum response tokens: 2000
- Step count limit: 3 (prevents infinite tool calls)
How It Works
RAG (Retrieval-Augmented Generation)
Uxie uses advanced RAG technology:AI Model
Gemini 2.5 Flash by Google:- Fast response times
- High-quality comprehension
- Strong reasoning capabilities
- Excellent at following instructions
google("gemini-2.5-flash") at /src/app/api/chat/route.ts:91
Tool Calling
The AI has access to thegetInformation tool:
Conversation Flow
System Prompt
The AI follows this directive:“You are a helpful assistant with access to a PDF document. Your primary task is to answer questions based on the content of this PDF. ALWAYS use the ‘getInformation’ function to search the PDF for relevant information.”Full prompt at
/src/app/api/chat/route.ts:157.
Multi-Step Reasoning
For complex questions:- AI may call
getInformationmultiple times - Each call refines the search based on previous results
- Up to 3 tool calls allowed per conversation turn
- Final response synthesizes all retrieved information
Best Practices
Privacy & Data
What data is sent?
What data is sent?
- Your question
- Retrieved document chunks (not the entire PDF)
- Previous conversation context
- Document ID (for retrieval)
Where is data stored?
Where is data stored?
- Embeddings: Pinecone vector database
- Chat history: Your Uxie database
- AI processing: Google’s Gemini API
Who can see chats?
Who can see chats?
- Only you and collaborators on the document
- Chats are private to each document
- No cross-document information sharing
Technical Implementation
API Route
Endpoint:/api/chat
Method: POST
Request body:
/src/app/api/chat/route.ts.
Vector Search
Query flow:- Convert question to embedding
- Search Pinecone for similar vectors
- Return top K most relevant chunks
- Pass chunks to AI for answer generation
/src/lib/vectorise.ts.
Component Architecture
/src/components/chat/index.tsx.
Troubleshooting
'Turn PDF Interactive' button doesn't work
'Turn PDF Interactive' button doesn't work
AI says 'information couldn't be found'
AI says 'information couldn't be found'
- The answer might not be in your document
- Try rephrasing your question
- Be more specific about which section to search
- Check if the document uploaded correctly
Responses are slow
Responses are slow
- Large documents take longer to search
- Complex questions may require multiple searches
- AI generation speed depends on server load
- Consider asking more focused questions
Chat history disappeared
Chat history disappeared
- Check if you’re viewing the correct document
- Refresh the page to reload history
- History is document-specific
Limitations
Related Features
Annotations
Explain and summarize highlights
Note Taking
AI writing assistance in notes
OCR
Make scanned PDFs AI-searchable
