Skip to content

feat: add premise relevance to retrieval filtering#49

Merged
rlippmann merged 1 commit into
mainfrom
retrieval_premise
Jul 6, 2026
Merged

feat: add premise relevance to retrieval filtering#49
rlippmann merged 1 commit into
mainfrom
retrieval_premise

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

Summary

Add premise-oriented retrieval coverage to the generic HR retrieval-filtering examples in Python and TypeScript.

The examples now show two separate host-owned retrieval decisions:

  • policy controls which HR documents are eligible
  • premise controls which eligible document is returned as relevant case evidence

The same query can now return different relevant documents when saved case context changes, while eligibility remains unchanged.

Why

Retrieval filtering previously demonstrated policy/access-control only.

This adds the remaining natural premise case for retrieval: persistent factual case context changing relevance within an already eligible document set.

The change keeps the access-control story intact and avoids using premise as disguised authorization:

  • use employee_hr_access grants eligibility to employee-facing documents
  • saved case premise narrows relevance inside that eligible set
  • premise does not grant access or select a collection
  • ChromaDB remains unchanged for this first generic pass

Example metadata

  • Enforcement point: retrieval filtering
  • Domain: HR policy lookup
  • Technology/runtime: generic Python and TypeScript
  • Example type: minimal example
  • Does this use directive drafter? should normally be no: no
  • Does this derive state from model output? must be no for primary examples: no

Checklist

  • Repository scaffolding / governance change
  • One primary enforcement point
  • Explicit authoritative state
  • No model-derived state mutation
  • Adversarial stub or equivalent test
  • Observable runtime behavior change
  • Domain vocabulary is natural
  • Framework is secondary to the enforcement point
  • Docs updated
  • Tests/smoke checks added where practical

Notes

Validation performed:

  • uv run --no-sync pytest python/tests/test_retrieval_filtering_example.py — passed, 13 passed
  • cd typescript/examples/retrieval_filtering/hr_policy_lookup && npm test — passed, 13 passed, 0 failed
  • cd typescript/examples/retrieval_filtering/hr_policy_lookup && npm run typecheck — passed
  • cd typescript/examples/retrieval_filtering/hr_policy_lookup && npm run build — passed
  • ./scripts/validate_python.sh — passed, 185 passed, 6 skipped
  • ./scripts/validate_typescript_fast.sh — passed
  • npx --yes markdownlint-cli2 python/examples/retrieval_filtering/README.md python/examples/retrieval_filtering/hr_policy_lookup/README.md typescript/examples/retrieval_filtering/README.md typescript/examples/retrieval_filtering/hr_policy_lookup/README.md — passed, 0 error(s)

ChromaDB files were intentionally left unchanged.

@rlippmann
rlippmann merged commit ae1ccbf into main Jul 6, 2026
6 checks passed
@rlippmann
rlippmann deleted the retrieval_premise branch July 6, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant