What I Built & Who It's For
For this weekend's "Build for a Friend" challenge, I built OpenCopilot—a lightweight, private Retrieval-Augmented Generation (RAG) assistant designed for my project teammate, Hasini.
During hackathons and semester project crunches, we juggle massive technical documentation, research papers, and API specs across dozens of tabs. Finding specific implementation constraints or database schemas under tight deadlines is a massive bottleneck.
OpenCopilot solves this by letting Hasini drop in research papers or project PDFs and immediately query them through a clean chat interface—getting precise answers grounded strictly in our project files without hallucinations.
The Open-Source AI Core
OpenCopilot was built around an entirely open ecosystem to ensure zero vendor lock-in, data privacy, and rapid iteration:
-
Embeddings: Hugging Face's open-source
sentence-transformers/all-MiniLM-L6-v2model running locally in Python to vectorize document chunks. - Vector Storage: ChromaDB, an open-source vector database that manages embeddings and similarity search directly on the host machine.
- LLM Reasoning: Powered by high-speed open-weights through Groq's open inference infrastructure, providing instant answers without subscription paywalls.
- Interface & Pipeline: Built using Streamlit with a direct, transparent RAG retrieval pipeline without heavy, opaque abstractions.
Why Open Innovation Matters Here
When building tools for university projects and peer collaboration, open innovation is essential:
- Academic Data Privacy: Hackathon prototypes and university research proposals often contain unpublished work. By leveraging local open-source embeddings and self-contained vector storage, proprietary project materials aren't indexed by proprietary cloud model providers.
- Zero Cost & Accessible Collaboration: Commercial LLM subscriptions and paid enterprise APIs are cost-prohibitive for students. An open stack allows our entire team to run and test the assistant without worrying about API quotas or monthly fees.
- Model Transparency & Portability: Unlike closed platforms where underlying models can be altered or deprecated overnight, open-source building blocks let us swap embedding models or switch the generation backend seamlessly.
Handing It Over: Teammate Feedback
I sent OpenCopilot over to Hasini to test against our latest coursework documentation.
"This cut through a 40-page technical specification in seconds. Instead of searching keywords across five open PDFs, I asked for the exact architectural constraints and got back the exact paragraphs I needed. It's going to save us hours on our upcoming hackathon deck."
How It Works
-
Ingest & Chunk: The user uploads a PDF in the Streamlit sidebar. The document is chunked into 500-character segments with overlap via
RecursiveCharacterTextSplitter. -
Vector Indexing: Embeddings are generated using
all-MiniLM-L6-v2and indexed in a local Chroma store. - Contextual Retrieval: User queries trigger a top-$k$ similarity search in Chroma to gather the most relevant document chunks.
- Grounded Generation: The retrieved context is formatted directly into a strict prompt template that forces the open-weight model to base its reasoning only on the provided evidence.
Development Session & Code
- GitHub Repository: https://github.com/SreeSruthiAlur/OpenCopilot-RAG
- Built and configured using Windsurf and DevRelay to track the iterative agent session.
Top comments (0)