Skip to content

fix(memory): preserve observation timestamp in extraction#5015

Open
haosenwang1018 wants to merge 1 commit intomem0ai:mainfrom
haosenwang1018:fix/extraction-observation-timestamp
Open

fix(memory): preserve observation timestamp in extraction#5015
haosenwang1018 wants to merge 1 commit intomem0ai:mainfrom
haosenwang1018:fix/extraction-observation-timestamp

Conversation

@haosenwang1018
Copy link
Copy Markdown

Summary

  • Pass metadata timestamp into the additive extraction prompt so historical conversations use the correct Observation Date.
  • Fall back to created_at when timestamp is not present.
  • Cover both sync and async extraction paths.

Closes #4963.

Testing

  • uv run --with pytest --with pytest-asyncio --with pytest-mock --with ruff python -m pytest tests/memory/test_main.py -q
  • uv run --with ruff ruff check mem0/memory/main.py tests/memory/test_main.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Observation Date falls back to Current Date during memory extraction when historical timestamp is provided

1 participant