Use Case: CreativeAnswer Knowledge Base Graph Builder
Automated pipeline that reads CA's historical project archive (Z1.4 Azure SQL), classifies and extracts structured entities via AI, builds a versioned knowledge graph in deltaPrism (CA tenant), and enables Relica to serve pre-processed context for offer writing. Runs in full-rebuild and incremental modes.
Version UC4-CA-v2.0Date 2026-05-03Owner Uued ViljapuuaiadStatus Specified -- Implementation PendingAuthority Tier 4
Section 01 -- Overview [M]
Field
Value
Use Case ID
UC4
Client Reference [M]
CreativeAnswer (CA) -- internal UV software agency knowledge base
System Name [M]
CA Knowledge Base Graph Builder
Domain [M]
Knowledge Management / AI-Driven Entity Extraction / Graph Database Population
One-Line Description [M]
AI-powered pipeline that transforms unstructured email attachment text into a typed, encrypted, versioned knowledge graph in deltaPrism for Relica consumption
The Source: CA's historical project knowledge -- contracts, client briefs, deliverables, project scopes, pricing structures -- is locked inside an Azure SQL email attachment archive (dbo.AttachmentIndex, "Z1.4"). Each row contains extracted plain text from an email attachment. Unstructured: no schema beyond extracted text and a status flag.
The Target: A typed, structured knowledge graph in the deltaPrism CA tenant containing five object classes (Contract, ClientBrief, Deliverable, ProjectScope, Client) with six relation types, PebbledGlass bins for encrypted access, and versioning. This is the pre-processed, persistent knowledge base that the offer-writing-webdev Relica profile traverses to generate context for offer writing.
The Gap:ca_graph_ingest.py is a prototype script that demonstrates the data flow. It is not a Nexus pipeline node, has no pipeline YAML, no caching contract, and no incremental update logic. This use case specifies the GraphBuildExecutor (new Nexus node type) and two pipeline definitions that replace it entirely.
Section 02 -- Actors [M]
Role [M]
Description [M]
Access Level [D]
Frequency [D]
System (Pipeline Nodes)
Automated pipeline execution: trigger, ingest, classify, extract, graph build, cache refresh, egress. No human interaction during runs.
Pipeline-internal only
Scheduled (nightly incremental, weekly full rebuild)
Admin (Pipeline Operator)
Triggers manual full rebuild runs. Monitors pipeline run logs. Configures batch size, provider, thresholds.
Pipeline trigger, run log access, config edit
Weekly / on-demand
Relica (Consumer)
Read-only consumer of the deltaPrism CA tenant graph. Never writes. Never calls Azure SQL directly.
P1 [M]: As the Pipeline, I read all qualifying rows from dbo.AttachmentIndex and classify each into one of five object classes (Contract, ClientBrief, Deliverable, ProjectScope, Client) via AI so downstream nodes can extract typed properties
P1 [M]: As the Pipeline, I extract structured properties from classified text using class-specific prompts injected via prompt_template_fields so the graph contains typed, structured data
P1 [M]: As the Pipeline, I encrypt sensitive fields with AES-256-GCM and write objects to deltaPrism with PebbledGlass bins so Relica can traverse without exposing raw data
P1 [M]: As the Pipeline, I check idempotency (source_id + content_hash) before every write so re-runs do not duplicate data
P1 [M]: As the Pipeline, I upsert a Client object for every extracted client_name so the graph maintains a canonical client registry
P1 [M]: As the Pipeline, I create relations between objects (ContractParty, ScopeAttachment, BriefSource, BriefOutcome, DeliverableScope, DeliverableContract) so the graph is traversable
Actor: Admin
P1 [M]: As Admin, I trigger a full rebuild run (UC4-1a) to populate the graph from scratch or sweep for consistency
P2 [D]: As Admin, I view run logs showing total processed, inserted, updated, skipped, and errored counts per run
Actor: Relica (Consumer)
P1 [M]: As Relica, I read from the deltaPrism CA tenant graph and raise GraphCacheEmpty if zero objects exist -- I never return placeholder data
P2 [D]: As Relica, I log WARN: graph_cache_stale if the last pipeline run is older than 48 hours (incremental) or 30 days (full rebuild)
Section 04 -- System Flows [M/D]
Flow A: UC4-1a -- Full Rebuild Pipeline (7 Steps) [M]
Trigger [M]: Manual trigger or scheduled (weekly Sunday 02:00). Passes run context: run_id, run_mode=full, started_at.
#
Step [M]
Actor [M]
Input [M]
Output [D]
Decision [M]
1
Scheduler Trigger
System / Admin
Manual button or cron schedule
run_id, run_mode=full, started_at
--
2
SourceIngest -- Azure SQL (Full Scan)
System
CA_SQL_CONN_STR, query: WHERE TextExtractionStatus='done' AND LEN(ExtractedText) > 100
Batch of {source_id, raw_text} events (batch size: CA_BATCH_SIZE, default 20)
Result [M]: All qualifying attachment rows classified, extracted, encrypted, and written to deltaPrism CA tenant graph with relations. Source rows watermarked. Relica can read the graph.
New rows: ingestion_status IS NULL AND TextExtractionStatus = 'done' AND LEN(ExtractedText) > 100
Changed rows: ingestion_status IS NOT NULL AND updated_at > {last_successful_run_at}
Zero-row exit: If no matching rows, pipeline exits with status success and total_processed=0. CacheRefresh still runs to confirm graph health. No error raised.
GraphBuildExecutor Idempotency Contract [D]
Every object written carries mandatory system properties:
source_id -- primary key from dbo.AttachmentIndex (idempotency key)
content_hash -- SHA-256 of raw_text at ingestion time (change detection)
gl_version -- integer starting at 1, incremented on each content change (plaintext PebbledGlass bin)
gl_ingested_at -- ISO 8601 timestamp of last successful write (plaintext)
Run record persists last_successful_run_at + last_run_stats (JSON). SourceIngest reads watermark from most recent UC4-1a or UC4-1b run.
Pending
REQ-GB-05
Zero-row exit: pipeline exits success with total_processed=0 when no matching rows. No error raised.
Pending
REQ-GB-06
No fallback data: unknown classification routes to Egress (skipped_unknown). Empty extraction writes system props only (gl_status=error). No invented values.
Pending
REQ-GB-07
Relation creation via deltaPrism POST /relations after primary object write. Unresolvable relations = warning (not error). No rollback.
Pending
REQ-GB-08
Client upsert: SHA-256 of normalised company name as key. Merge properties (not overwrite). Increment gl_version only if changed.
Pending
Related Artefacts [D]
Artefact
Location
Relationship
CA Tenant Schema
Relica/docs/RELICA_CA_TENANT_SCHEMA
Canonical object class and property schema. AI prompt content source.
RAID DP-007
Relica/docs/RAID_LOG
Resolved by this use case spec. Status: ACTIVE -> RESOLVED when UC4-1a completes.
RAID DP-008
Relica/docs/RAID_LOG
Resolved by REQ-GB-03. Status: ACTIVE -> RESOLVED when provider config implemented.
Relica HLD
Relica/docs/RELICA_HLD
Relica reads from deltaPrism CA tenant (this pipeline's output).
Prototype script
Wormwood/scripts/ca_graph_ingest.py
Reference implementation. Deprecated when UC4-1a pipeline succeeds.