This document outlines the comprehensive query processing pipeline for the Contextual AI Assistant, detailing how user queries are analyzed, processed, and answered using the Mem0 memory system with Neo4j as the graph store.
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ │ │ │ │ │
│ Query │ │ Query │ │ Intent │
│ Reception ├────►│ Preprocessing ├────►│ Classification │
│ │ │ │ │ │
└──────────────────┘ └──────────────────┘ └─────────┬────────┘
│
▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ │ │ │ │ │
│ Response │ │ Context │ │ Strategy │
│ Generation │◄────┤ Integration │◄────┤ Execution │
│ │ │ │ │ │
└──────────────────┘ └──────────────────┘ └─────────┬────────┘
│ │
│ ▼
│ ┌──────────────────┐
│ │ │
│ │ Memory │
│ │ Retrieval │
▼ │ │
┌──────────────────┐ └──────────────────┘
│ │
│ Response │
│ Delivery │
│ │
└──────────────────┘
Purpose: Receive and validate incoming user queries
Components:
/chat_completionInput Example:
{
"query": "What messages haven't I replied to on WhatsApp?",
"user_id": "user_123"
}
Output: Validated query object with metadata
Purpose: Prepare the raw query for intent classification and processing
Components: