Here's a comprehensive high-level architecture diagram for the Contextual AI Assistant with Mem0 and Neo4j:
┌─────────────────────────────────────────────────────────────────────────┐
│ Client Applications │
│ │
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ Desktop App │ │ Web Client │ │ Mobile App │ │
│ └───────┬───────┘ └───────┬───────┘ └───────┬───────┘ │
└──────────┼───────────────────────┼───────────────────────┼──────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────────┐
│ API Layer │
│ │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ │ │ │ │
│ │ Ingestion API │ │ Query API │ │
│ │ (/ingest) │ │ (/chat_completion)│ │
│ │ │ │ │ │
│ └──────────┬──────────┘ └──────────┬──────────┘ │
└─────────────┼────────────────────────────────────────────┼──────────────┘
│ │
▼ │
┌─────────────────────────────┐ │
│ Processing Layer │ │
│ │ │
│ ┌─────────────────────┐ │ │
│ │ App Classification │ │ │
│ └──────────┬──────────┘ │ │
│ │ │ │
│ ▼ │ │
│ ┌─────────────────────┐ │ │
│ │ │ │ │
│ │ Application │ │ │
│ │ Parsers │ │ │
│ │ │ │ │
│ │ ┌───────────────┐ │ │ │
│ │ │ Messaging │ │ │ │
│ │ │ Parser │ │ │ │
│ │ └───────────────┘ │ │ │
│ │ ┌───────────────┐ │ │ │
│ │ │ GitHub │ │ │ │
│ │ │ Parser │ │ │ │
│ │ └───────────────┘ │ │ │
│ │ ┌───────────────┐ │ │ │
│ │ │ Other App │ │ │ │
│ │ │ Parsers │ │ │ │
│ │ └───────────────┘ │ │ │
│ └──────────┬──────────┘ │ │
│ │ │ │
│ ▼ │ │
│ ┌─────────────────────┐ │ │
│ │ Entity Extraction │ │ │
│ └──────────┬──────────┘ │ │
│ │ │ │
│ ▼ │ │
│ ┌─────────────────────┐ │ │
│ │ Relationship │ │ │
│ │ Identification │ │ │
│ └──────────┬──────────┘ │ │
└─────────────┼───────────────┘ │
│ │
▼ ▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Memory Layer │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Mem0 Client │ │
│ │ │ │
│ │ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │ │
│ │ │ │ │ │ │ │ │ │
│ │ │ Vector Store │ │ Key-Value │ │ Graph Store │ │ │
│ │ │ │ │ Store │ │ │ │ │
│ │ │ (Qdrant) │ │ (Redis) │ │ (Neo4j) │ │ │
│ │ │ │ │ │ │ │ │ │
│ │ └────────────────┘ └────────────────┘ └────────────────┘ │ │
│ │ │ │
│ │ ● Semantic Search ● Direct Lookups ● Relationships │ │
│ │ ● Content Storage ● Entity States ● Graph Traversal │ │
│ │ ● Similarity ● Fast Access ● Network Analysis │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
▲
│
│
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ Query Layer │
│ │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ Query Analysis │ │ Query Strategies │ │
│ │ │────▶ │ │
│ │ ● Intent Detection │ │ ┌─────────────────┐ │ │
│ │ ● Type Classification │ │Team │ │ │
│ │ │ │ │Identification │ │ │
│ └─────────────────────┘ │ └─────────────────┘ │ │
│ │ ┌─────────────────┐ │ │
│ │ │Unreplied │ │ │
│ │ │Messages │ │ │
│ │ └─────────────────┘ │ │
│ │ ┌─────────────────┐ │ │
│ │ │Pending Reviews │ │ │
│ │ └─────────────────┘ │ │
│ └──────────┬──────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ Response Generation │ │
│ │ │ │
│ │ ┌─────────────────┐ ┌─────────────────┐ ┌──────────┐ │ │
│ │ │ Context │ │ LLM Integration │ │ Response │ │ │
│ │ │ Retrieval │───▶│ (OpenAI) │───▶│ Assembly │ │ │
│ │ └─────────────────┘ └─────────────────┘ └──────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
/ingest): Receives screen data from clients/chat_completion): Handles user questions and returns answers