Use cases and boundaries
Compose direct task context with records retrieved from an explicit store. Namespace filters scope lookup, priorities make budget decisions inspectable, and snapshots give a digest that can be logged alongside a review. The memory store is the persistence boundary; the in-memory implementation is useful for fixtures.
Getting started and compatibility
This project is under development. Check out the pinned revision, install its development dependencies and run npm run build from the repository root. The ESM build requires Node.js ^20.19.0 || >=22.12.0 and produces dist/index.js. The sample .mjs file at the root uses an in-memory store and prints a digest of the selected context and budget. Pinned source entry · Pinned build manifest
import { createContextBuilder, InMemoryMemoryStore } from './dist/index.js';
const context = await createContextBuilder({ memory: new InMemoryMemoryStore(), budget: { maxTokens: 64 } })
.addItem({ id: 'task', type: 'task.input', content: 'Review a route.', priority: 10 })
.build();
console.log(context.snapshot.digest);