AI-Powered Email Search Assistant with Advanced Cognitive Architecture

2024

Problem

Superhuman users spend up to 35 minutes per week searching email and calendar by keyword, because they must recall exact phrases and sender names. The team built Ask AI to answer such queries in natural language. The first version was a single-prompt RAG system. It did not follow task-specific instructions reliably and reasoned poorly about dates, such as finding upcoming deadlines. It handled flights and company-update summaries but not calendar availability or multi-step searches.

Example from the article: a query such as "When did I meet the founder of that series A startup for lunch?" in an inbox of 45,873 emails.

Solution in brief

Replace the single prompt with a parallel pipeline. A classifier picks the tools and prompt for each query while a second process extracts search filters. Hybrid search with reranking retrieves results, and a prompt chosen by the class writes the answer. Key instructions are repeated in the system prompt and the final user message.

Questions this case answers
  • How to make a retrieval-augmented assistant handle several query types reliably when one prompt cannot follow all task-specific instructions
  • How to roll out a generative search feature in stages and validate it before general availability
  • How to build an LLM assistant that answers questions over a user's email and calendar
  • How to make a RAG assistant follow task-specific instructions and reason about dates

Tools and methods

  • Query classification — routes each query to one of five paths
  • Metadata extraction — time, sender and attachment filters
  • Hybrid search with reranking — semantic plus keyword retrieval, results reranked for relevance
  • Task-specific prompts — rules, few-shot examples, user preferences per query class
  • Llama 3.1 8B, GPT-4o — classifier and answer models (per the diagram)
Continue reading — it's free

Google or a one-time email code. No password.