Skip to main content

Module compression_semantic

Module compression_semantic 

Source
Expand description

Semantic Structured Compression — RML-1208

Compresses verbose memory content into structured summaries targeting ~30x token reduction using rule-based NLP techniques. Pure computation — no database access, no network I/O.

§Pipeline

  1. Split text into sentences
  2. Strip filler and hedging phrases
  3. Extract proper nouns and number/date entities
  4. Derive subject-verb-object cores
  5. Deduplicate near-identical sentences (Jaccard > 0.6)
  6. Reassemble structured_content and key_facts

§Invariants

  • Never panics on any input (including empty strings)
  • Token estimation uses text.len() / 4
  • Short content below min_content_length is returned verbatim

Structs§

CompressedMemory
The result of compressing a single piece of text.
CompressionConfig
Configuration for the semantic compressor.
SemanticCompressor
Rule-based semantic compressor — no ML required.