Skip to content

Memory

Topic Summary

The memory layer gives agents durable access to semantic context, structured knowledge, historical state, and retrievable domain information.

Stack Level

Memory is Layer 5 of the Agentic Web Stack. It decides what context survives beyond one prompt, how information is retrieved, and how structured or semantic knowledge becomes available to agents.

Goals

  • Compare vector databases, knowledge graphs, and hybrid memory patterns.
  • Document how memory supports RAG, semantic search, and reasoning over relationships.
  • Keep storage choices modular and replaceable.

Common Tech Stack

TechnologyRole in memory
Vector databasesStore embeddings and run similarity search for semantic retrieval
Chroma, Qdrant, WeaviateCommon dedicated vector database options
pgvectorVector search inside PostgreSQL for teams already using relational data
Embedding modelsConvert text or multimodal content into searchable vectors
RAG pipelinesRetrieve relevant context before model generation
Knowledge graphsStore explicit entities, relationships, and paths for reasoning
Neo4j, RDF, SPARQLCommon graph database and semantic web technologies
Object storageStore source documents, files, artifacts, and large binary content

Reference Scenario

The Literature Review Assistant uses semantic retrieval for relevant passages and a graph model for explicit paper-author-topic relationships. The combination supports both similarity search and relationship-aware context expansion.

Standards and Protocols

  • Vector search APIs
  • RDF and SPARQL for graph-oriented knowledge
  • Property graph patterns
  • Embedding and retrieval pipelines

Example Use Case

A research agent needs to answer questions about a collection of technical papers. It stores chunks and embeddings in a vector database, keeps paper-author-topic relationships in a graph, and retrieves both semantic matches and explicit relationships before generating an answer.

Example Memory Specification Sketch

yaml
corpus:
  name: agentic-web-papers
  sourceStorage: s3://example-research-corpus/papers/
chunking:
  strategy: markdown-section
  maxTokens: 700
  overlapTokens: 100
embeddings:
  model: text-embedding-example
  dimensions: 1536
vectorIndex:
  engine: qdrant
  collection: agentic_web_chunks
  distance: cosine
  payloadFields:
    - documentId
    - title
    - section
    - sourceUrl
knowledgeGraph:
  engine: neo4j
  nodes:
    - Paper
    - Author
    - Topic
  relationships:
    - WRITTEN_BY
    - CITES
    - DISCUSSES
retrieval:
  topK: 8
  filters:
    visibility: public
  graphExpansion:
    enabled: true
    maxHops: 2

Example artifact: memory.yaml.

Design Considerations

  • Keep source documents separate from vector and graph indexes.
  • Store source IDs in every retrieved chunk so answers can cite evidence.
  • Combine semantic retrieval with metadata filters and policy checks.
  • Define retention, privacy, and deletion expectations before storing user data.

Page created by Dr. C. Klukas