Skip to content

contextweaver

Phase-specific, budget-aware context compilation for tool-using AI agents.

Zero runtime dependencies · deterministic output · Python ≥ 3.10


contextweaver provides two cooperating engines that solve the context window problem for tool-using AI agents:

  • Context Engine — eight-stage pipeline: candidates → dependency closure → sensitivity filter → firewall → scoring → dedup → selection → rendering.
  • Routing Engine — bounded DAG + beam search over large tool catalogs, producing compact LLM-friendly ChoiceCards.

Get started

10-Minute Quickstart{ .md-button .md-button--primary } API Reference{ .md-button }

Section What you'll find
Quickstart Install, first context build, firewall demo, routing demo
Concepts Core type glossary: ContextItem, Phase, ChoiceGraph, …
Runtime Loop Four-phase flow diagram and pseudo-code
MCP Integration Tool conversion, session loading, firewall with MCP
A2A Integration Agent cards and multi-agent sessions
Architecture Pipeline details, design rationale, module map
API Reference Auto-generated reference from source docstrings