PURE PYTHON CONTEXT MEMORY FOR LOCAL LLMs
$ pip install qontext-memory
from qontext_memory import MemoryStore
store.save(context_window)
Qontext-memory is a dependency-free Python library for replacing or augmenting regular context memory on local small LLM workflows. Try the Hugging Face Space to see the retrieval pack built in your browser.
PRODUCT TRAILER
This promotional video captures the idea and spirit of Qontext-memory. It is not a technical demonstration of how the library works. Try the live demo to explore the actual retrieval experience.
THE LOCAL CONTEXT PROBLEM
Qontext was inspired by the Quipu, the ancient Inca recording device where information lived in knots across woven cords. Local models run inside real limits: smaller windows, tighter memory, and no appetite for bloated infrastructure. Qontext-memory gives those workflows a dedicated way to keep useful context available.
Holds the active prompt mass your local model is currently carrying.
Keeps reusable interaction context available outside the active prompt window.
Recalls only the useful working context before the next response.
BUILT FOR SMALL LOCAL MODELS
SAME RETRIEVAL SHAPE AS THE LIVE DEMO
TECHNICAL MANUAL
Qontext keeps a conversation as short, self-contained facts called knots and returns only the ones a question needs. The core is pure Python, one file, no dependencies, and supports Python 3.8+.
Long conversations do not fit in small context windows. Qontext keeps token cost flat with a fixed-size summary that does not grow with the conversation.
Measured result: ~118x token reduction on 800-turn conversations.
Metric
Full transcript
Qontext pack
Accuracy
10.0 / 10
9.7 / 10
Prompt tokens per call
13,853
117
Prompt processing
5.8 s
0.7 s
Most usage only needs max_entries and speakers. The default speakers="all" stores each speaker’s facts; speakers="user" restricts extraction to the user.
A knot must name its subject.
The payload is the point.
Fewer, better knots.
RPMemory treats state as payload for scenes and characters, reserving budget for standing facts like place, possession, condition, kinship, and commitment.
qontext_cords.py records how knots hang together and walks those links at retrieval time.
qontext_weave.py and seed_weave.py add optional word association; measured neutral to slightly harmful, so off by default.
llm_judge_bridge.py can use a local LLM judge through an OpenAI-compatible endpoint for harder retrieval categories.
— Benchmark questions are hand-written by the project.
— Measurements come from a small number of machines and quantised local models.
— Answers are scored by keyword match, not judgement.
— Roleplay recall uses a proxy metric without model-in-the-loop validation.
LICENSING
Qontext-memory uses the PolyForm Noncommercial License 1.0.0. Research, teaching, personal projects, non-profit, educational, and government use are free; commercial use requires a separate license.
$99 one-time
One developer, one commercial product, under $100k/year revenue.
Paid commercial use requires an actual signed commercial-license grant alongside the PolyForm Noncommercial public repo. Checkout is not connected yet; request the grant below.
$499/year
Up to 5 developers, unlimited internal or commercial products, under $1M/year revenue.
Paid commercial use requires an actual signed commercial-license grant alongside the PolyForm Noncommercial public repo. Checkout is not connected yet; request the grant below.
$1,500/year
Up to 20 developers, commercial distribution allowed, with priority licensing support.
Paid commercial use requires an actual signed commercial-license grant alongside the PolyForm Noncommercial public repo. Checkout is not connected yet; request the grant below.
Custom
OEM embedding, redistribution, procurement, legal review, or larger teams.
Paid commercial use requires an actual signed commercial-license grant alongside the PolyForm Noncommercial public repo. Checkout is not connected yet; request the grant below.
LICENSE DOCUMENTS
Each fixed tier includes its own license grant. Enterprise is a negotiation framework, not a signable grant by itself.
Qontext-memory keeps the implementation small, local, and dependency-free.
LOCAL MODEL MEMORY · PURE PYTHON · NO DEPENDENCIES