Trimwise is an open-source Python library for selecting the most relevant, verbatim passages from a known source under exact token, word, or character budgets. It preserves source order and returns original character spans for auditability, with lexical, semantic, and hybrid selection modes. Built for RAG, agents, and prompt pipelines, with reproducible benchmarks and a public research artifact.
In agentic workflows, raw command outputs and state recollection after compaction contribute to major token waste. Agents often pull raw terminal output into context even when they only need a few anchors, then pay the same cost again later when compaction forces them to reread files or rerun commands.
CtxSift was built to cut that loop down to two operations: keep only the signal that matters now, then recover it later without rebuilding the whole state trail.
Hi All! While working on my MCP gateway, realized that for some tools, it would inject instructions in the tool description which would contribute to context bloat when many servers are configured with it.
Added in Code-Mode support to address this problem. What is code-mode? Well, simply put, it allows agents to progressively discover tools as per its needs. Instead of dumping all tool descriptions and schemas in the prompt, it exposes 3-5 meta tools that allow Agents to query and discover the exact tools they need. The result? Lesser token usage, reduced latency, reduced tool hallucinations and forgetfulness.