A simple, local-first chatbot that helps users understand Kolibri. This version is designed to work locally without complex external dependencies.
npm installCreate a .env.local file in the root directory and add your API keys:
OPENAI_API_KEY=your_openai_api_key_here
GOOGLE_APPLICATION_CREDENTIALS=./your-service-account-key.jsonTo get an OpenAI API key:
- Go to OpenAI Platform
- Sign up or log in
- Create a new API key
- Copy it to your
.env.localfile
To set up Google Drive access:
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable Google Drive API and Google Docs API
- Create a service account and download the JSON key
- Place the JSON file in your project root and update the path in
.env.local
npm run devNavigate to http://localhost:3000
- Simple Chat Interface: Clean, responsive chat UI
- Google Drive Integration: Access documents from your Google Drive folder
- Content-Based Search: Find relevant information within document content
- Vector Search: Semantic search using AI embeddings for better understanding
- Real-time Responses: Streaming responses from OpenAI
- Document Citations: See which documents were used to generate responses
- Frontend: Next.js 14 with TypeScript and Tailwind CSS
- AI: OpenAI GPT-3.5-turbo via AI SDK
- Vector Search: OpenAI text-embedding-3-small via AI SDK
- Google Drive: Google Drive API and Google Docs API
- Styling: Tailwind CSS for responsive design
- State Management: React hooks with AI SDK
- ✅ Chat interface with document-based responses
- ✅ Google Drive integration for document access
- ✅ Content-based search within documents
- ✅ Vector search using AI embeddings
- ✅ Real-time message streaming
- ✅ Document citations and links
- ✅ Responsive design
- ✅ TypeScript support
The chatbot includes advanced vector search using AI SDK embeddings:
- Document Indexing: Documents are split into chunks and converted to embeddings
- Semantic Search: User queries are converted to embeddings and matched semantically
- In-Memory Storage: Fast, local storage with file persistence
- Better Understanding: Finds conceptually related content, not just exact matches
- Improved Accuracy: More relevant responses even with different word choices
- Context Awareness: Understands user intent and context
- No External Dependencies: Uses only OpenAI API, no vector databases needed
- Index Documents:
POST /api/index-documents(one-time setup) - Test Search:
POST /api/test-vector-searchwith{"query": "your question"} - Automatic: The chatbot automatically uses vector search when available
- Google Drive integration for document access
- Document search and retrieval
- Source citation with document links
- Conversation history persistence
- Advanced UI features
- Make sure you have a valid OpenAI API key in
.env.local - Check that the API key has sufficient credits
- Run
npm installto ensure all dependencies are installed
- The app runs on port 3000 by default
- If busy, Next.js will automatically try the next available port
This is a simplified version designed for local development. It uses:
- Basic system prompt instead of document retrieval
- No authentication (simple guest access)
- No database (conversations not persisted)
- No external services beyond OpenAI API
Perfect for testing and development before adding more complex features!