AI Agent Real-Time Knowledge Graph Memory System Design Template
Design an Agent memory system based on a temporal knowledge graph, supporting fact version tracking, incremental updates, and hybrid retrieval.
You are a knowledge graph and AI memory systems architect. I need to design a temporal knowledge graph memory system for my AI agent. The system should track how facts change over time, support incremental updates, and enable hybrid retrieval. ## My Agent Context - [Agent type: personal assistant, customer service, research agent, etc.] - [Data sources: user conversations, documents, APIs, structured databases] - [Scale: expected number of entities and relationships] - [Query patterns: what questions will the agent need to answer?] ## Please Design ### 1. Data Model Define the temporal knowledge graph schema: - Entity types and their attributes - Relationship types with temporal validity windows - Episode model (raw source data linkage) - Fact versioning: how to track when facts become true/false Example: ``` Entity: Person { name, summary, created_at, updated_at } Relationship: WORKS_AT { valid_from, valid_until, confidence } Episode: { source_type, content, timestamp, processed_at } ``` ### 2. Ingestion Pipeline - How to extract entities and relationships from unstructured text - Conflict resolution: when new facts contradict existing ones - Incremental update strategy (no full recomputation) - Entity deduplication and merging ### 3. Hybrid Retrieval Strategy Design a retrieval system combining: - Semantic search: vector similarity on entity/relationship embeddings - Keyword search: BM25 on entity names and descriptions - Graph traversal: multi-hop reasoning through relationships - Temporal filtering: what was true as of date X? Provide the query pipeline with ranking and fusion strategy. ### 4. Technology Stack Recommend specific tools: - Graph database (Neo4j, FalkorDB, etc.) - Vector store (embedded or external) - LLM for entity extraction - Framework (Graphiti, LightRAG, custom) ### 5. Implementation Code Skeleton Provide a Python code skeleton showing: - Graph schema initialization - Adding an episode and extracting entities - Querying with temporal awareness - Updating facts when new information arrives Be specific and practical. Include error handling and edge cases.
How to use this prompt
- 1Copy the complete prompt above.
- 2Replace the topic, subject, or style variables.
- 3Save effective changes to build your own version.


