Library · published 2026-04-10 · added 2026-08-28 · github.com

context-engine

What it is

A pure-Python library that manages LLM context by combining retrieval, re-ranking, memory decay, and token budget enforcement into a single pipeline. It uses numpy for core calculations and optionally sentence-transformers for hybrid retrieval, allowing developers to control exactly what information is passed to the model under strict token constraints.

The problem it solves

Standard RAG implementations often ignore token limits and context relevance, leading to wasted tokens, irrelevant information, or context window overflow.

What you could use it for

llmragcontext-managementpythontoken-budget

Read the source ↗Back to the library →

Summary written by an AI model from the source; check the source before you rely on it.