CIGAR · v0.10.0 beta 1

The right context. Within your budget.

CIGAR selects relevant information from your documents and code, keeps source citations, and fits it into the context budget you set.

Open source · Rust-powered · Apache-2.0

  1. Add your sources

    Pass in the documents or code your agent needs.

  2. Set a question and budget

    CIGAR selects relevant information that fits.

  3. Use the cited context

    Send the result to your model with its source references.

WHY CIGAR

Useful context, less manual assembly.

Fit your budget

Set a token limit for the selected context, including citations. Reserve space separately for your prompt and model response.

Keep the source

Trace selected information back to its document or code. Inspect what your agent receives before it calls the model.

Update what changed

Replace a source as it changes. The local graph updates its index without rebuilding everything.

TRY V0.10.0 BETA 1

Add CIGAR to your application.

The new Python and TypeScript SDKs run the same Rust context graph locally. No server or API key needed.

Beta for Apple-silicon Macs (macOS ARM64). For evaluation; not yet production-ready.

Python

0.10.0b1

Python 3.14

Python install
python3.14 -m pip install 'hol-cigar==0.10.0b1'

See a working Python example
Python example
from cigar_sdk import LocalContextGraph

with LocalContextGraph("website-example") as graph:
    graph.replace_source("docs/retry.md", [
        {
            "id": "retry",
            "source": "docs/retry.md",
            "text": "Retry only idempotent operations.",
        }
    ])
    result = graph.compile({
        "query": "idempotent retry",
        "max_tokens": 512,
        "reserve_tokens": 64,
    })
    assert graph.verify(result["snapshot"]) == result
    assert result["snapshot"]["stats"]["rendered_tokens"] <= 448
    print(result["rendered"])

Download Python example

Run: python3.14 local-context.py

TypeScript / Node

0.10.0-beta.1

Node 24.10–24.x · ESM

TypeScript / Node install
npm install '@hol-org/[email protected]'

See a working TypeScript / Node example
TypeScript / Node example
import { LocalContextGraph } from "@hol-org/cigar/context";

const graph = await LocalContextGraph.create("website-example");
try {
  await graph.replaceSource("docs/retry.md", [
    {
      id: "retry",
      source: "docs/retry.md",
      text: "Retry only idempotent operations.",
    },
  ]);
  const result = await graph.compile({
    query: "idempotent retry",
    max_tokens: 512,
    reserve_tokens: 64,
  });
  await graph.verify(result.snapshot);
  if (result.snapshot.stats.rendered_tokens > 448) {
    throw new Error("Context exceeded its budget");
  }
  console.log(result.rendered);
} finally {
  await graph.close();
}

Download TypeScript / Node example

Run: node local-context.mjs

Your app chooses the sources and calls the model. CIGAR prepares the context. Release notes and platform details

CIGAR RELEASES

Find the right release for your project.

See what changed in each version, check compatibility, and find the packages and release notes.

View releases