Add temporal scoring#1436
Conversation
8958eda to
428604f
Compare
428604f to
2b536e5
Compare
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
Signed-off-by: Edwin Yu <edwinyyyu@gmail.com>
472f008 to
b933eb6
Compare
| timestamp_prefix = f"[{formatted_timestamp}] " if formatted_timestamp else "" | ||
|
|
||
| match segment.context: | ||
| return f"{timestamp_prefix}{EventMemory._context_prefix(segment.context)}" |
There was a problem hiding this comment.
It looks like the segment header only has the prefix, not the value. Not sure if this really can help for LLM.
There was a problem hiding this comment.
The segment_header staticmethod is meant to generate a header for content that shares the same context (e.g. a single timestamp and speaker for chunks from the same message)
| # DateDataParser takes settings only at construction time, so we | ||
| # build a fresh parser per call (its construction cost is small; | ||
| # ``RELATIVE_BASE`` is the per-call signal). | ||
| parser = DateDataParser(languages=["en"], settings=settings) |
There was a problem hiding this comment.
It will be better to detect the language type first.
There was a problem hiding this comment.
We will need a pluggable language detection service then, which needs a new feature, or get the locale from the client.
| return None | ||
|
|
||
|
|
||
| class DucklingTemporalExtractorParams(BaseModel): |
There was a problem hiding this comment.
Does this require configuration update?
There was a problem hiding this comment.
This did not exist before, so it needs to be added to configuration for it to work on the server.
Duckling requires a Duckling server (running separately).
| from memmachine_server.temporal.time_range import TimeRange | ||
|
|
||
|
|
||
| def _temporal_anchors_from_context(context: Context | None) -> list[TimeRange]: |
There was a problem hiding this comment.
The logic not integrated into the query data path yet?
Purpose of the change
Improve ability to process temporal retrieval signals.
Description
Make Context composable. Use Context to hold temporal information.
Does not really stack with reranker or #1444 on locomo.
Temporal match score component weight must be tuned for the embedder.
Approach works on synthetic data with harder temporal queries (works well for deictics, complex time ranges).
Recency/proximity not included (design less finalized). Temporal signal for introducing candidates to the pool not well-explored (requires new tables and indexing).
Add temporal extractors and query planners.
Type of change
How Has This Been Tested?
Tested on synthetically generated data with more difficult temporal problems.
Checklist
Maintainer Checklist