Skip to content

[DRAFT] Persist identifiers in DB#2164

Draft
behnam-o wants to merge 1 commit into
microsoft:mainfrom
behnam-o:persist-identifiers
Draft

[DRAFT] Persist identifiers in DB#2164
behnam-o wants to merge 1 commit into
microsoft:mainfrom
behnam-o:persist-identifiers

Conversation

@behnam-o

Copy link
Copy Markdown
Contributor

Problem

This is phase 7 of this proposal: PyRIT Unified Registry — Design & Rationale

this draft uses TargetIdentifier and their relationship with Conversation as example, if we concensus on the pattern, this will be extended to all identifiers.

Target identifiers weren't persisted as first-class, queryable data. Their configuration (endpoint, model, sampling params) and their composition (multi-targets wrapping inner targets) were only available inline, with no deduplication and no way to query across them.

Solution

Persist TargetIdentifiers as content-addressed rows keyed by their content hash, so an identical identifier reused across many conversations maps to a single immutable row.

Mechanisms:

  • Content-addressed value store — the full identifier dump (identifier_json) is the immutable source of truth; frequently-queried fields are surfaced as denormalized columns (indexes into the blob, not a second source of truth).
  • from_domain_model seam — a uniform, per-entry converter defining how a domain model becomes a row, enforced on concrete subclasses at class-definition time.
  • Recursive persistence with a child graph — multi-target composition is stored as an ordered parent→child edge table, materialized by a recursive write path that mirrors the existing "persist dependencies first" contract, with idempotent insert-if-absent semantics.

Why draft

Raising as a draft to validate the pattern (DomainBackedEntry + content-addressed store + recursive child graph) on target identifiers first. If it looks good, the same approach extends cleanly to the other identifier types.

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