Inspiration
Students and researchers increasingly rely on AI to study lecture notes, textbooks, and research papers. However, answering questions about large documents often requires sending thousands of prompt tokens to an LLM for every query, increasing both latency and API costs.
We built CAPS (Concept Check & Study Companion) to demonstrate how Paritok can reduce this overhead. By compressing retrieved document context before it reaches the LLM, CAPS helps students get fast, high-quality answers while using significantly fewer prompt tokens.
What it does
CAPS is an AI-powered study assistant that allows users to upload PDF, DOCX, and TXT documents and interact with them using natural language.
Features
- Ask Questions: Chat with your uploaded documents.
- Generate Study Guides: Automatically create concise study material from lecture notes.
- Summarize Content: Quickly summarize long chapters or research papers.
- Extract Key Concepts: Identify important ideas and definitions.
- Generate Quizzes: Create multiple-choice questions for revision.
Paritok A/B Comparison
CAPS includes a built-in Paritok Toggle that allows users to compare the exact same query using two different execution paths.
Paritok OFF
Retrieved document context is sent directly to Groq (llama-3.3-70b).
Paritok ON
The same context is first compressed using Paritok's hosted Compress API before being sent to Groq.
For every response, CAPS displays:
- Prompt Tokens
- Tokens Saved
- Estimated Cost Reduction
- Response Latency
This makes the benefits of context compression immediately visible instead of hidden behind the scenes.
How we built it
- Frontend: Next.js (App Router), React, TypeScript, and Tailwind CSS
- Document Processing:
unpdfandmammothfor extracting text from PDF and DOCX files - Retrieval: Lightweight keyword-based retrieval without requiring a vector database
- Context Compression: Paritok Hosted Compress API
- LLM: Groq running
llama-3.3-70b - Storage: Vercel KV (Upstash Redis)
Challenges we ran into
One challenge was integrating Paritok's hosted REST API into a web application while handling occasional cold-start delays gracefully.
Another challenge was creating a fair A/B comparison. We wanted users to compare compressed and uncompressed requests without introducing caching bias, so both execution paths use the same retrieval process and rely on Groq's reported prompt token usage rather than estimates.
We also spent time tuning the compression pipeline to reduce context size while preserving important concepts, formulas, and explanations.
Accomplishments that we're proud of
- Built a complete AI study assistant powered by Paritok context compression.
- Successfully demonstrated significant prompt token reduction while maintaining useful study responses.
- Created an interactive A/B comparison that allows users to immediately see the effect of context compression.
- Delivered a fully deployed Next.js application with document upload, AI chat, analytics, and study tools.
What we learned
Building CAPS showed us that document-based AI applications often send far more context to the LLM than is actually necessary.
Even after retrieving relevant sections, prompts frequently contain repeated explanations, formatting, and unnecessary text.
Using query-aware context compression before inference can significantly reduce prompt size while preserving the information needed to answer user questions.
We also learned that making token usage visible helps users better understand the real cost of AI applications instead of treating it as a hidden implementation detail.
What's next for CAPS
We plan to continue improving CAPS by adding:
- YouTube lecture transcript support
- Audio lecture summarization
- Exportable flashcards for Anki and Quizlet
- Improved retrieval for larger document collections
- Collaborative study workspaces with shared documents and cumulative token savings
Built With
- groq
- next.js
- paritok
- react
- redis
- tailwind-css
- typescript
- upstash
- vercel

Log in or sign up for Devpost to join the conversation.