Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 3.53 KB

README.md

File metadata and controls

56 lines (41 loc) · 3.53 KB

Python examples

These examples show how Context Compiler state changes application behavior at runtime.

Each example focuses on an enforcement point where saved premise and policy affect what a host allows, routes, retrieves, builds, or executes.

The core library lives in context-compiler. Directive recognition can be added with context-compiler-directive-drafter, but that layer is optional. This package is the examples and integration patterns layer.

context-compiler defines the authority contract. context-compiler-directive-drafter can optionally help acquire and draft authority, but it is not the authority layer. This examples package shows where authority is enforced.

Prompt reinjection influences model behavior. Context Compiler influences runtime behavior.

Generic examples

  • Checkpoint continuation: persisted confirmation and resume flows change host behavior across turns or requests
  • Execution authorization: protected host actions execute only when authoritative state allows them
  • Gateway middleware: the host allows, blocks, or routes requests before downstream work runs
  • Prompt construction: the host builds different request or prompt payloads from authoritative state
  • Retrieval filtering: the host changes which documents are eligible or relevant before returning results
  • Schema selection: the host picks different workflow or response schemas from authoritative state
  • Tool gating: the host changes which tools are visible or executable at runtime

Reference integrations

Python also includes reference integrations for runtime-specific behavior after the generic examples.

Open a reference integration when you want to see the same kind of runtime behavior on a specific host or framework surface.

Start with the generic example first, then use the Python reference integrations to inspect a runtime-specific path:

Run an example

To explore or run an example, use a repository checkout:

  1. Clone context-compiler-example-integrations.
  2. Choose a generic example or a reference integration.
  3. Open that example's README.
  4. Follow the example-specific setup, runtime, and validation instructions.