feat: Red Flag DD workflow, unified file_id, and document-file linking#834
Conversation
…on examples Rename examples/workflows/contract-generation/ to docx-generation/ and add a new red-flag-dd.json workflow that reuses the same structured DOCX round-trip pattern (RAG index → extract → batch LLM → apply modifications) with DD-specific prompts for due diligence report generation from VDR documents.
Unify naming to use file_id consistently in the RAG service API, database schema, platform callers, and tests. Adds a runtime migration helper (ensure_file_id_column) for existing databases. Extracts shared RAG result parsing into parse_search_results and adds source filename annotations to formatted search results.
…uman input status Add documentId field to fileMetadata schema to establish a bidirectional link between files and documents. This includes schema changes, mutation updates, a backfill migration, and new linkDocumentToFile internal mutation. OneDrive import flows now propagate documentId through the pipeline. Fix chat sidebar to show "awaiting input" (yellow dot) instead of "running" (spinner) when a workflow is paused for human input on a sub-thread, by cross-referencing execution IDs across approvals. Add tests for fileMetadata mutations and document upload flows.
Add FileID annotation to RAG search result output so agents can reference specific files. Update parser regex to handle the new annotation and add tests for file_id formatting.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR unifies identifiers across the RAG, Convex platform, and database layers by systematically replacing Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
red-flag-dd.jsonworkflow example that uses the structured DOCX round-trip pattern (RAG index → extract → batch LLM → apply modifications) for due diligence report generation from VDR documents. Reorganizeexamples/workflows/by renamingcontract-generation/todocx-generation/.file_idacross RAG API: Renamedocument_idtofile_idthroughout the RAG service (API, database, platform callers, tests) for consistent naming. Add runtime migration helper and extract shared result parsing intoparse_search_resultswith source filename annotations.documentIdfield tofileMetadataschema establishing bidirectional file↔document linking, with schema changes, mutation updates, backfill migration, and OneDrive import propagation.FileIDannotation in formatted search output so agents can reference specific files.Test plan
fileMetadatamutations and document upload flowsdocument_retrieve_tooltests forfile_idnamingfind_document_by_file_idteststest_rag_service,test_search_service,test_indexing_service) forfile_idformat_search_resultstests updated forfile_idannotationSummary by CodeRabbit
New Features
Improvements