ContextAI
Turn noisy WhatsApp exports into relevant answers, action items, decisions, and key facts. A retrieval-augmented chat analyser with a Python backend and PostgreSQL vector search.
Find the useful signal in a chat export
Group conversations mix decisions, tasks, repeated messages, and system metadata. Scrolling through a raw WhatsApp export makes it difficult to find an answer or recover the commitments buried in the conversation.
ContextAI ingests exported .txt files and builds a retrieval-augmented analysis workflow. A natural-language question retrieves relevant conversation context before Gemini produces a structured response.

From raw text to retrieved context
Custom parsing and regular expressions remove timestamps, system messages, and metadata noise. Cleaned message events are embedded and stored in PostgreSQL with pgvector.
For each question, cosine-similarity search retrieves the five most relevant context items. Those retrieved messages form the context for synthesis rather than sending every message as an undifferentiated prompt.
Structured answers with a clear contract
The response prompt organises output into three categories: Action Items, Decisions Made, and Key Facts. A typed JSON structure gives the consuming application predictable fields.
My implementation work covered the vector-storage model, semantic top-five retrieval, preprocessing, and prompt/output structure. The workflow supports natural-language questions and contextual task extraction.
Trade-offs
| Choice | Reason | Open question |
|---|---|---|
| Custom export parsing | Remove common metadata and system noise before embedding. | How well does parsing generalise across export formats? |
| PostgreSQL + pgvector | Store vectors and retrieve semantic context in one database. | How should indexing and query cost evolve with larger exports? |
| Top-five semantic retrieval | Keep synthesis context focused. | Are all messages needed for a decision actually retrieved? |
| Typed JSON categories | Offer predictable fields for tasks, decisions, and facts. | How often are outputs valid and grounded in the source messages? |
Delivered scope & validation questions
The README documents a working backend pipeline for ingestion, noise reduction, vector storage, retrieval, and structured synthesis. It does not report an accuracy benchmark, latency measurements, or a test-pass count.
Useful follow-up evaluation would measure retrieval relevance, factual grounding, action-item completeness, JSON validity, and performance across different chat-export formats. These remain validation questions, rather than measured project results.
FAQ
What does ContextAI ingest?
Exported WhatsApp .txt conversation files. Custom parsing removes system and metadata noise before embedding.
What was your contribution?
Core backend development: the RAG architecture, preprocessing, vector-storage model, top-five retrieval, and structured response prompting. It was a team hackathon project.
How is relevant context selected?
Cosine-similarity search in PostgreSQL with pgvector retrieves the five most relevant context items for the question.
Does structured JSON guarantee correct answers?
No. It gives the application a predictable output format. Retrieval coverage and factual grounding still need evaluation.