Expand description
Hybrid scoring for memory recall.
Functions§
- compute_
score - Compute 9-component hybrid score for a memory against a query.
The
graphparameter is used to look up edge counts for graph strength scoring. Thebm25parameter provides BM25-based token overlap scoring; if the memory is in the index it uses the indexed score, otherwise falls back toscore_text. Thenowparameter makes scoring deterministic and testable by avoiding internal clock reads. - graph_
strength_ for_ memory - Compute graph strength for a memory node by combining raw graph metrics.
- truncate_
content - Re-export the canonical truncate from codemem-core.
Truncate a string to
maxbytes, appending “…” if truncated. Handles multi-byte UTF-8 safely by finding the nearest char boundary.