Skip to content

feat(agents)!: in LongTermMemory add failure policy and remove ingestion timing#1963

Merged
serge-p7v merged 10 commits intodevelopfrom
serge/ltmImprovements
May 7, 2026
Merged

feat(agents)!: in LongTermMemory add failure policy and remove ingestion timing#1963
serge-p7v merged 10 commits intodevelopfrom
serge/ltmImprovements

Conversation

@serge-p7v
Copy link
Copy Markdown
Collaborator

@serge-p7v serge-p7v commented May 6, 2026

The PR fixes two issues in LongTermMemory:

  1. Retrieval and ingestion errors on storage level are skipped.
  2. Double-ingestion of messages during active session.

Also, the PR improves the default InMemoryRecordStorage and makes the feature non-experimental.

BREAKING:

  • LongTermMemory IngestionTiming is gone
  • QueryExtractor -> SearchQueryProvider
  • ExtractionStrategy -> DocumentExtractor

DEPRECATED:
*

closes

Copy link
Copy Markdown
Collaborator

@EugeneTheDev EugeneTheDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Am I right that the main logical change is that there's no option to select ingestion timing now. Now automatic ingestion, if configured, happens only once per agent execution, after the agent completes, and the whole prompt is used to search for relevant facts?

And the FailurePolicy, of course

@serge-p7v
Copy link
Copy Markdown
Collaborator Author

Looks good. Am I right that the main logical change is that there's no option to select ingestion timing now. Now automatic ingestion, if configured, happens only once per agent execution, after the agent completes, and the whole prompt is used to search for relevant facts?

And the FailurePolicy, of course

Thanks! The ingestion now happens only at the end, but only the last user message (before LLM call) is used for retrieval with the default LastUserMessageQueryExtractor.
By the way, the naming might be a bit confusing:

  • ai.koog.agents.longtermmemory.retrieval.QueryExtractor is for deciding which string to use for search in an external storage;
  • ai.koog.agents.longtermmemory.ingestion.extraction.ExtractionStrategy is for converting prompt messages to text documents for inserting them into the external storage.

I'll think about the naming a bit more, "extract" in both places is not great.

@serge-p7v serge-p7v force-pushed the serge/ltmImprovements branch from a0ee00f to 7118fd4 Compare May 7, 2026 10:15
@serge-p7v serge-p7v merged commit dc9b8c8 into develop May 7, 2026
30 of 32 checks passed
@serge-p7v serge-p7v deleted the serge/ltmImprovements branch May 7, 2026 13:12
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.

2 participants