Skip to content

Context orchestration for agentic systems.

License

Notifications You must be signed in to change notification settings

FunkyDruid/contextrie

 
 

Repository files navigation

Contextrie header

Contextrie

Context-aware memory for agentic workflows. Contextrie curates what each agent sees so tasks stay sharp from step one to step one thousand.

Quickstart

bun add contextrie
import { Contextrie } from "contextrie";

const ctx = new Contextrie({
  ingester: { model },
  assessor: { model },
  compose: { model },
});

await ctx.ingest.file("./docs/contract.md").file("./docs/clauses.csv").run();

const assessment = await ctx.assess
  .task("Find clauses about SLA violations")
  .from(ctx.sources)
  .run();

const context = await ctx.compose
  .task("Find clauses about SLA violations")
  .from(assessment.rated)
  .density("balanced")
  .run();

console.log(context);

Why Contextrie

Long-running agents accumulate noise. Contextrie keeps a working memory that evolves with the task, compressing and expanding sources so the right details are visible at the right time.

How it works

Three-stage pipeline: Ingest → Assess → Compose.

  • Ingest files and generate compact metadata (title, description, keypoints)
  • Assess sources for relevance to each task (shallow or deep)
  • Compose a task-specific context at the right density

Supported file types: .md, .txt, .csv.

Key capabilities

  • Compact metadata for fast relevance matching
  • Task-scoped scoring with shallow and deep modes
  • Context compression with density presets or numeric values
  • Source lineage preserved for expansion later
  • Designed for multi-step, agentic workflows

Demo

See the end-to-end legal contract review example in demo/README.md.

Links

Roadmap (planned)

Planned features include organic memory (forgetfulness/remembrance), feedback-loop assembly, per-item assessment, and additional file types.

Status

Contextrie is in early development. The core pipeline (Ingest → Assess → Compose) is functional, but the API is still taking shape.

License

MIT

About

Context orchestration for agentic systems.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.0%
  • JavaScript 3.0%