Lightweight Queryable Context Compression is a local-first .capsule context dictionary for long-running AI conversations.
LQCC saves the full visible history locally, extracts a searchable context dictionary, and gives the next AI session only the small context packet it needs.
- no-SQL packed
.capsulefile format - Python CLI for Linux, Windows, and macOS
- one-command beginner flow:
lqcc quick chat.md - interactive terminal menu:
lqccorlqcc menu - local HTTP daemon for automatic appends and retrieval
- OpenAI-compatible non-streaming proxy that records requests and replies
- command wrapper that records command output as tool context
- search and resume from the capsule without loading full history
- PDF, image, text, code, and binary attachments with AI-readable sidecars
- full-history export and capsule verification
- reader skill for Codex, Claude Code, Cursor, and other agents
From TestPyPI:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple lqccFrom source:
git clone https://github.com/zjnbwxq/lqcc.git
cd lqcc
python -m pip install -e ".[multimodal]"Check:
lqcc --versionExpected:
lqcc 0.7.1
lqcc quick examples/demo_chat.mdThis creates examples/demo_chat.capsule and prints a small packet you can paste into a new AI chat.
lqcc build chat.md -o project.capsule --title "My Project"
lqcc search project.capsule "what did we decide?"
lqcc resume project.capsule --task "continue the project" --budget 800
lqcc verify project.capsulelqccor:
lqcc menuThe menu lets users build, resume, search, append, attach, verify, start a daemon, or start a proxy without remembering command syntax.
Use the daemon when another tool or agent should write into and read from a capsule automatically.
lqcc daemon project.capsule --port 8765Endpoints:
GET /health
GET /stats
POST /append
POST /append-many
POST /resume
POST /search
POST /get
POST /attach
Example:
curl -X POST http://127.0.0.1:8765/append \
-H "Content-Type: application/json" \
-d '{"role":"user","content":"Decision: keep active context small."}'Use the proxy when an API client should send messages through LQCC so visible messages are automatically written to the capsule.
export OPENAI_API_KEY="your-key"
lqcc proxy project.capsule \
--upstream https://api.openai.com/v1/chat/completions \
--context-mode auto \
--port 8765Then point the client to:
http://127.0.0.1:8765/v1/chat/completions
Context modes:
pass record messages, forward original request
resume forward a capsule resume packet plus recent messages
auto use pass until the request becomes large, then use resume
Current limitation: streaming proxy responses are not supported in 0.7.1. Use non-streaming requests.
Use wrap to record command output as tool context:
lqcc wrap project.capsule -- python -m pytestThis records the command start, exit code, stdout, and stderr into the capsule.
See:
reader-skill/SKILL.md
reader-skill/SKILL.zh-CN.md
The skill tells an agent to use lqcc resume first, then lqcc search or lqcc get only when more evidence is needed.
LQCC 0.7.1 handles visible text and file artifacts. It does not capture hidden chain-of-thought. It does not include a browser extension yet. Browser support, desktop UI, stronger multimodal indexing, and stable v1.0 format guarantees are future work.
MIT.