Ragtime is a modern RAG (Retrieval-Augmented Generation) chatbot designed to help engineers query technical documentation using natural language. Built with LangChain, OpenAI, Chroma, and Next.js.
- Smart Document Ingestion: Upload
.md,.txt, or.mdxfiles, or ingest directly from URLs - LangChain Integration: Built on LangChain's robust RAG pipeline
- Vector Search: Powered by Chroma vector database with OpenAI embeddings
- Source Attribution: See exactly which documents were used to answer your questions
- Modern UI: Clean, responsive chat interface inspired by chat.langchain.com
- Real-time Chat: Interactive conversation with your documentation
| Layer | Tech Used |
|---|---|
| Backend | Node.js, Express, LangChain |
| Frontend | Next.js 14, React, TypeScript, Tailwind CSS |
| Embedding | OpenAI API (text-embedding-3-small) |
| LLM | OpenAI GPT-4o-mini |
| Vector DB | Chroma (in-memory) |
| Other | Lucide React, clsx, tailwind-merge |
git clone https://github.com/yourusername/ragtime.git
cd ragtimecd backend
npm installcd ../frontend
npm installCreate a .env file in the backend/ directory:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcd backend
npm run devcd frontend
npm run devThe app will be available at:
- Frontend: http://localhost:3001
- Backend API: http://localhost:3000
ragtime/
├── backend/
│ ├── routes/
│ │ ├── upload.js # File upload endpoints
│ │ ├── query.js # Query processing endpoints
│ │ └── ingest.js # Document ingestion endpoints
│ ├── services/
│ │ ├── ragService.js # Main RAG pipeline (LangChain)
│ │ └── docIngester.js # Document fetching & processing
│ ├── .env # API keys
│ ├── package.json
│ └── server.js # Express server
├── frontend/
│ ├── app/
│ │ ├── globals.css # Global styles
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Main chat interface
│ ├── lib/
│ │ └── utils.ts # Utility functions
│ ├── package.json
│ └── tailwind.config.js # Tailwind configuration
└── README.md
Click the "📚 Load LangChain Docs" button in the UI to automatically fetch and ingest LangChain's documentation from GitHub.
Use the upload button to add your own .md, .txt, or .mdx files.
Type natural language questions about your documentation and get AI-powered answers with source attribution.
curl -X POST http://localhost:3000/api/query \
-H "Content-Type: application/json" \
-d '{"query": "What is LangChain?"}'curl -X POST http://localhost:3000/api/upload \
-H "Content-Type: multipart/form-data" \
-F "file=@your-doc.md"curl -X POST http://localhost:3000/api/ingest/langchain-docscurl http://localhost:3000/api/query/statsThe backend uses LangChain's RAG pipeline with:
- Text Splitting: RecursiveCharacterTextSplitter with 1000-character chunks
- Embeddings: OpenAI's text-embedding-3-small model
- Vector Store: Chroma with cosine similarity search
- LLM: GPT-4o-mini with custom prompt engineering
The frontend is built with:
- Next.js 14: App Router for modern React development
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- Lucide React: Beautiful icons
This project is designed for local development. To deploy to production, you would need to:
- Set up a production server (e.g., AWS, DigitalOcean, Railway)
- Configure environment variables
- Set up a persistent vector database (Chroma server)
- Deploy both backend and frontend
OPENAI_API_KEY=your_openai_api_key
NODE_ENV=production
PORT=3000✅ v1 Complete: LangChain-based RAG pipeline
✅ Modern UI: Next.js frontend with chat interface
✅ Document Ingestion: File upload + GitHub integration
✅ Source Attribution: See which documents were used
✅ Real-time Chat: Interactive conversation interface
🛠 Future Enhancements:
- YouTube transcript ingestion
- Confidence scoring
- RAGAS evaluation integration
- Multi-modal document support
- Advanced filtering and search
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request