Skip to content

[GH-703] Semantic: Add ingestion trigger configuration. - #755

Merged
o-love merged 1 commit into
MemMachine:mainfrom
o-love:ingestion-filtering
Dec 16, 2025
Merged

o-love merged 1 commit into
MemMachine:mainfrom
o-love:ingestion-filtering

Conversation

@o-love

@o-love o-love commented Dec 10, 2025 •

Copy link
Copy Markdown
Contributor

Adds in ingestion trigger parameters to Semantic Memory Config.

In addition adds time based age trigger.

The timedelta can be represented as an ISO string or a numeric representation in seconds.

    raw_conf = {
        "ingestion_trigger_age": "PT2M",
    }
    conf = SemanticMemoryConf(**raw_conf)
    assert conf.ingestion_trigger_age == timedelta(minutes=2)
# ---------------
    raw_conf = {
        "ingestion_trigger_age": 120.5,
    }
    conf = SemanticMemoryConf(**raw_conf)
    assert conf.ingestion_trigger_age == timedelta(minutes=2, milliseconds=500)

Fixes/Closes

#703
#753

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

In addition adds in time based trigger.
@o-love
o-love requested review from Copilot, edwinyyyu, jealous and malatewang and removed request for malatewang December 10, 2025 17:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds configurable ingestion trigger parameters to the Semantic Memory system, addressing issue #703. The changes introduce both message count and time-based age triggers for controlling when ingestion occurs.

Key changes:

  • Adds ingestion_trigger_messages and ingestion_trigger_age configuration fields to SemanticMemoryConf with support for ISO duration strings and numeric seconds
  • Introduces created_at timestamp tracking for history entries across all storage implementations
  • Renames feature_update_message_limit to uningested_message_limit for clarity throughout the codebase

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/memmachine/common/configuration/__init__.py Adds ingestion trigger configuration fields to SemanticMemoryConf
src/memmachine/common/configuration/mixin_confs.py Adds timedelta serialization support for YAML output
src/memmachine/common/resource_manager/semantic_manager.py Wires new configuration parameters to semantic service initialization
src/memmachine/semantic_memory/semantic_memory.py Renames parameter, adds time-based filtering to background ingestion task
src/memmachine/semantic_memory/storage/storage_base.py Adds older_than parameter to get_history_set_ids interface
src/memmachine/semantic_memory/storage/sqlalchemy_pgvector_semantic.py Implements created_at column and older_than filtering for PostgreSQL storage
src/memmachine/semantic_memory/storage/neo4j_semantic_storage.py Implements created_at property and older_than filtering for Neo4j storage
tests/memmachine/semantic_memory/storage/in_memory_semantic_storage.py Implements created_at tracking and older_than filtering for in-memory test storage
src/memmachine/semantic_memory/storage/alembic_pg/versions/62dff1150a46_add_created_at_to_history_add.py Database migration to add created_at column to history table
tests/memmachine/common/configuration/test_semantic_conf.py Adds tests for new configuration fields with various input formats
tests/memmachine/semantic_memory/storage/test_semantic_storage.py Adds comprehensive tests for older_than filtering behavior
Various test files Updates test fixtures to use renamed uningested_message_limit parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/memmachine/semantic_memory/storage/test_semantic_storage.py
@o-love o-love changed the title [GH-703] Add ingestion trigger configuration. [GH-703] Semantic: Add ingestion trigger configuration. Dec 10, 2025
@ChristianKniep

Copy link
Copy Markdown
Contributor

@o-love I gave it a go using this config:

semantic_memory:
  database: db_neo4j
  embedding_model: openai_embedder
  llm_model: openai_model
  ingestion_trigger_age: 60s

When storing a memory it still does not trigger an ingestion

memmachine-app  | 2025-12-11T08:35:30.352178636Z INFO:     192.168.97.1:36990 - "POST /api/v2/memories HTTP/1.1" 200 OK
memmachine-app  | 2025-12-11T08:35:52.166129832Z INFO:     127.0.0.1:50618 - "GET /api/v2/health HTTP/1.1" 200 OK
memmachine-app  | 2025-12-11T08:36:22.269620508Z INFO:     127.0.0.1:37718 - "GET /api/v2/health HTTP/1.1" 200 OK
memmachine-app  | 2025-12-11T08:36:52.344529650Z INFO:     127.0.0.1:38660 - "GET /api/v2/health HTTP/1.1" 200 OK
memmachine-app  | 2025-12-11T08:37:22.402466516Z INFO:     127.0.0.1:41412 - "GET /api/v2/health HTTP/1.1" 200 OK

@o-love

o-love commented Dec 12, 2025 •

Copy link
Copy Markdown
Contributor Author

@ChristianKniep I think you aren't using this branch properly. The provided config is invalid and would cause an error during startup.
You can use an ISO string or provide the seconds in numeric(not string) format.

You can look at the tests or pr description to see usages of both.

@o-love
o-love merged commit 409785a into MemMachine:main Dec 16, 2025
38 of 40 checks passed
SarahScargall pushed a commit to SarahScargall/MemMachine that referenced this pull request Dec 19, 2025
SarahScargall pushed a commit to SarahScargall/MemMachine that referenced this pull request Jan 29, 2026
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.

5 participants