Datasets:

Modalities:
Tabular
Text
Languages:
English
ArXiv:
DOI:
License:

[Discussion] SVO-based fact extraction vs raw embedding for agent episodic memory

#80
by Spy9191 - opened

Two approaches to storing agent observations in memory:

Approach A — Raw embedding: Take the agent's output text, embed the whole chunk, store in vector DB. Retrieve by cosine similarity at query time.

Approach B — SVO extraction: Parse the agent's output into Subject-Verb-Object triples ("user moved to London", "project uses TypeScript"). Store structured facts. Retrieve by subject lookup and temporal filter.

The tradeoff:

  • Approach A is fast to implement and handles unstructured narrative well.
  • Approach B is slower to implement but gives you precise supersession: when "user lives in New York" is contradicted by "user moved to London", you can deterministically close the old fact's validity window and never retrieve it again.

For episodic task execution logs, Approach A is fine. For semantic facts about the user, project, or world state that change over time, Approach B is far more reliable in production.

Interested whether the HuggingFace agent community has a preferred approach here — particularly for frameworks like smolagents where memory persistence across restarts matters.

Sign up or log in to comment