1.6 KiB
1.6 KiB
Data Model: Unified AI Architecture
Entity: migration_review_queue
Stores legacy document processing results waiting for human-in-the-loop validation.
Table Structure:
id(INT, PK, Auto Increment) - Internal IDpublic_id(BINARY(16), UUIDv7, Unique, Indexed) - Exposed to API (ADR-019)batch_id(VARCHAR) - Groups documents from a single runoriginal_file_name(VARCHAR) - Name of the uploaded PDFextracted_metadata(JSON) - The AI-extracted fields (title, date, categories, etc.)confidence_score(DECIMAL) - Overall AI confidence score (0.0 to 1.0)status(ENUM) -PENDING,IMPORTED,REJECTEDerror_reason(TEXT, Nullable) - Populated if status isREJECTEDversion(INT) - OptLocking via@VersionColumncreated_at(TIMESTAMP)updated_at(TIMESTAMP)
Entity: ai_audit_logs
Development feedback logs for recording AI vs Human decisions.
Table Structure:
id(INT, PK, Auto Increment) - Internal IDpublic_id(BINARY(16), UUIDv7, Unique, Indexed) - Exposed to APIdocument_public_id(BINARY(16), Nullable) - References the document if successfully importedmodel_name(VARCHAR) - LLM Model used (e.g., "gemma4:9b")ai_suggestion_json(JSON) - What the AI suggestedhuman_override_json(JSON) - What the human actually savedconfidence_score(DECIMAL)confirmed_by_user_id(INT) - FK to users tablecreated_at(TIMESTAMP)
Entity: Project (Existing)
Added Context: The publicId of this table is injected natively into Qdrant payload filters as project_public_id for multi-tenant isolation.