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.

Type
Team hackathon project
Role
Core backend developer · RAG pipeline
Scope
WhatsApp chat analysis

Tech stack

  • Python
  • Gemini
  • PostgreSQL
  • pgvector
  • Vector embeddings
  • Regex parsing

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.

ContextAI WhatsApp dashboard showing a selected group conversation, message count, analysis depth, and Analyze Chat button
The WhatsApp workspace brings chat selection and analysis controls into one view. Private chat names are redacted.

Custom parsing and regular expressions remove timestamps, system messages, and metadata noise. Cleaned message events are embedded and stored in PostgreSQL with pgvector.

WhatsApp .txt export
Parse + clean message events
Generate embeddings
PostgreSQL + pgvector
Cosine similarity · top 5 context items
Gemini → structured JSON

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.

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.

ChoiceReasonOpen question
Custom export parsingRemove common metadata and system noise before embedding.How well does parsing generalise across export formats?
PostgreSQL + pgvectorStore vectors and retrieve semantic context in one database.How should indexing and query cost evolve with larger exports?
Top-five semantic retrievalKeep synthesis context focused.Are all messages needed for a decision actually retrieved?
Typed JSON categoriesOffer predictable fields for tasks, decisions, and facts.How often are outputs valid and grounded in the source messages?

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.

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.

Project details and measurements from the repository README ↗.Checked 24 October 2026

LET’S CONNECT

LET’S TALK ABOUTWHAT’S NEXT.

I’m open to contracts, internships, and remote engineering roles.

STRAIGHT TO MY INBOX