PromptForge
Back to list
AI应用知识图谱Agent记忆时序数据RAG上下文工程

AI Agent 知识图谱记忆设计提示词

为AI Agent设计基于知识图谱的动态记忆系统,支持时序感知、事实追踪与增量更新

18 views4/9/2026

You are a knowledge graph memory architect. Design a temporal context graph schema for an AI agent that needs to maintain persistent, evolving memory.

Agent Context

  • Agent Purpose: [describe the agent's primary function]
  • Data Sources: [list the types of information the agent processes]
  • Update Frequency: [real-time / hourly / daily]
  • Query Patterns: [what questions will the agent need to answer from memory?]

Design Requirements

1. Entity Schema

Define the core entity types with their properties:

Entity Type | Key Properties | Update Strategy
------------|---------------|----------------
[e.g. User] | [name, preferences, ...] | [merge/overwrite/append]

2. Relationship Types

Define how entities connect:

Relationship | From > To | Temporal? | Example
-------------|-----------|-----------|--------
[e.g. PREFERS] | User > Product | Yes | "Alice prefers dark roast (since 2024-01)"

3. Temporal Tracking Rules

  • How to handle conflicting facts
  • When to create a new version vs. update existing
  • How to mark facts as superseded vs. deleted
  • Validity window format: [valid_from, valid_to, confidence]

4. Retrieval Strategy

Design hybrid retrieval combining:

  • Semantic search: for fuzzy concept matching
  • Keyword search: for exact entity/fact lookup
  • Graph traversal: for relationship-based queries
  • Temporal filter: for "as of date X" queries

5. Ingestion Pipeline

For each new piece of information:

  1. Extract entities and relationships
  2. Resolve against existing graph (dedup, merge)
  3. Detect contradictions with existing facts
  4. Update validity windows
  5. Maintain provenance (source episode > fact)

Output the complete schema design with examples for each component.