Context Compressor
interface ContextCompressor
Compresses source text to extract only the portions relevant to entity resolution.
Instead of passing entire conversations or documents to LLM calls, this extracts snippets around entity mentions to reduce token usage while preserving disambiguation context.
Example:
Full context (500 tokens):
"Hello! How are you today? I've been listening to a lot of music lately.
Speaking of which, I really love Brahms. His symphonies are incredible,
especially the Fourth. The way he develops themes... [300 more tokens]"
Compressed (50 tokens):
"...I really love Brahms. His symphonies are incredible, especially the Fourth..."Content copied to clipboard