Askly is a high-performance RAG (Retrieval-Augmented Generation) system that lets you chat with your documents and falls back to the internet when it doesn't know the answer. Built with Google Gemini, ChromaDB, and real-time streaming.
- PDF Intelligence: Upload any PDF to index it into ChromaDB Cloud for instant local retrieval.
- Smart Fallback: If Askly can't find the answer in your documents, it automatically triggers a Tavily Web Search.
- Real-time Streaming: AI responses stream word-by-word via Server-Sent Events (SSE) β exactly like ChatGPT.
- Markdown Rendering: Responses render rich markdown β including bold text, lists, and code blocks.
- Modern UI: A premium, responsive chat interface built with React, Shadcn UI, and Lucide Icons.
- Attachment System: Modern AI-style file attachments for seamless document indexing.
- Real-time Logging: Backend middleware logs every interaction with timestamps.
Ask anything without uploading a file β Askly falls back to live Tavily web search and streams the answer with a π WEB SEARCH badge.
Upload any PDF, then ask questions about its content β Askly indexes it into ChromaDB and streams answers from your own data.
Askly follows a robust RAG lifecycle:
- Ingestion: PDFs are parsed, chunked, and vectorized using Google Gemini Embeddings (
gemini-embedding-001) before being stored in ChromaDB Cloud. - Retrieval: Queries are converted to vectors and compared via Cosine Similarity to find the most relevant document chunks.
- Synthesis: If document similarity is below threshold, Askly searches the web via Tavily.
- Generation: The final context is sent to Gemini 2.5 Flash which streams the answer back word-by-word through Server-Sent Events.
User sends message
β
Frontend creates empty assistant bubble
β
POST /api/query/stream (SSE endpoint)
β
Backend yields: { sources, isFromWeb } β then { chunk: "word" } Γ N β [DONE]
β
Frontend ReadableStream reader appends each chunk to the bubble in real-time
Ensure you have Node.js v18+ installed and the following API keys:
- Google Gemini API Key β FREE at aistudio.google.com
- ChromaDB Cloud β API Key, Tenant, and Database name from trychroma.com
- Tavily API Key β FREE tier at tavily.com
Create a .env file inside the server/ directory:
GEMINI_API_KEY=your_gemini_key
CHROMA_API_KEY=your_chroma_key
CHROMA_TENANT=your_tenant_id
CHROMA_DATABASE=askly
TAVILY_API_KEY=your_tavily_keyInstall dependencies for both client and server:
# Install Server deps
cd server
npm install
# Install Client deps
cd ../client
npm installStart the development servers for both:
Backend (Server):
cd server
npm run devFrontend (Client):
cd client
npm run devThe application will be available at http://localhost:5173.
| Technology | Purpose |
|---|---|
| React 19 + Vite | UI framework & build tool |
| Tailwind CSS v4 | Styling |
| Shadcn UI + Radix | Component library |
| react-markdown | Render AI markdown responses |
| Lucide Icons | Icon set |
| Technology | Purpose |
|---|---|
| Node.js + Express | HTTP server |
| TypeScript + Tsx | Type safety & dev runner |
| Google Gemini SDK | LLM generation + embeddings |
| ChromaDB Cloud | Vector store |
| Tavily API | Web search fallback |
| Multer | PDF file upload handling |
| pdf-parse | PDF text extraction |
| Server-Sent Events | Real-time streaming |
askly/
βββ client/ # React frontend
β βββ src/
β βββ components/
β β βββ chat/ # ChatHeader, ChatMessage, ChatInput
β β βββ ui/ # Shadcn components
β βββ types/ # Shared TypeScript types
β βββ App.tsx # Main app with SSE streaming logic
βββ server/ # Express backend
βββ src/
βββ lib/
β βββ rag.ts # RAG engine (query + queryStream)
β βββ embedding.ts # Gemini vector embeddings
β βββ vectorStore.ts # ChromaDB integration
β βββ search.ts # Tavily web search
β βββ utils.ts # Text chunking
βββ server.ts # Express endpoints (+ /api/query/stream)
Askly is designed to be visually stunning and highly functional. It features:
- Glassmorphism: Elegant card layouts with backdrop blurs.
- Micro-animations: Smooth transitions for message bubbles and loaders.
- Responsiveness: Fully optimized for mobile and desktop screens.
- Streaming UX: Text types itself out word-by-word for a natural, fast-feeling experience.
Important
To use real AI responses, ensure you have a GEMINI_API_KEY set in your .env file. You can get one for free at Google AI Studio.
Note
The embedding model (gemini-embedding-001) produces 3072-dimensional vectors. ChromaDB collections must be consistent β run a DB reset if switching embedding models.
Contributions are welcome! Whether it's a bug fix, new feature, or documentation improvement β every bit helps.
- π Read the Contributing Guide before submitting a PR
- π Report bugs via GitHub Issues
- π‘ Suggest features via the Feature Request template
- π Report security issues privately via SECURITY.md
- π€ Please follow our Code of Conduct
Developed with β€οΈ as part of the Askly RAG Learning Series.



