This document details the data flow and component interactions within the Contextual AI Assistant architecture, explaining how data moves through the system and how components communicate with each other.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ │ │ │ │ │ │ │
│ Client │ │ Ingestion │ │ Application │ │ Entity │
│ Application ├────►│ API ├────►│ Classifier ├────►│ Extractor │
│ │ │ │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│
│
▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ │ │ │ │ │ │ │
│ Mem0 │ │ Memory │ │ Relationship│ │ Application │
│ Client │◄────┤ Entry │◄────┤ Identifier │◄────┤ Parser │
│ │ │ Builder │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│
│
▼
┌─────────────────────────────────────────────────────┐
│ │
│ Mem0 Storage │
│ │
│ ┌───────────────┐ ┌───────────────┐ ┌──────────┐ │
│ │ Vector Store │ │ Key-Value │ │ Graph │ │
│ │ (Embeddings) │ │ Store │ │ Store │ │
│ └───────────────┘ └───────────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────┘
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ │ │ │ │ │ │ │
│ Client │ │ Query │ │ Query │ │ Strategy │
│ Application ├────►│ API ├────►│ Analyzer ├────►│ Selector │
│ │ │ │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│
│
▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ │ │ │ │ │ │ │
│ Client │ │ Response │ │ LLM │ │ Mem0 │
│ Application │◄────┤ Formatter │◄────┤ Processor │◄────┤ Client │
│ │ │ │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
│
│
▼
┌─────────────────────────────────────┐
│ │
│ Mem0 Storage │
│ │
│ ┌───────────┐ ┌─────┐ ┌────────┐ │
│ │ Vector │ │ KV │ │ Graph │ │
│ │ Store │ │Store│ │ Store │ │
│ └───────────┘ └─────┘ └────────┘ │
│ │
└─────────────────────────────────────┘
Data Format: JSON payload containing screen content and metadata
Communication: HTTP POST request to /ingest endpoint
Headers: Contains user identification (X-User-ID)
Example Payload:
{
"content": "Alice: Can you review my PR?\\\\nMe: Sure, I'll take a look.",
"metadata": {
"app_name": "whatsapp",
"timestamp": "2025-04-17T00:30:45Z",
"device_id": "laptop-1234"
}
}
Input: Raw screen content and metadata
Process: Analyzes content to determine application type
Output: Application type identifier (e.g., "messaging", "github")
Implementation:
app_type = classify_application(content, metadata)