Major release with significant performance improvements and new processing strategy. ## Core Changes - Implemented simple_full_document processing strategy (default) - Full document → LLM approach: 1-2 passes, ~5-6 minutes processing time - Achieved 100% completeness with 2 API calls (down from 5+) - Removed redundant Document AI passes for faster processing ## Financial Data Extraction - Enhanced deterministic financial table parser - Improved FY3/FY2/FY1/LTM identification from varying CIM formats - Automatic merging of parser results with LLM extraction ## Code Quality & Infrastructure - Cleaned up debug logging (removed emoji markers from production code) - Fixed Firebase Secrets configuration (using modern defineSecret approach) - Updated OpenAI API key - Resolved deployment conflicts (secrets vs environment variables) - Added .env files to Firebase ignore list ## Deployment - Firebase Functions v2 deployment successful - All 7 required secrets verified and configured - Function URL: https://api-y56ccs6wva-uc.a.run.app ## Performance Improvements - Processing time: ~5-6 minutes (down from 23+ minutes) - API calls: 1-2 (down from 5+) - Completeness: 100% achievable - LLM Model: claude-3-7-sonnet-latest ## Breaking Changes - Default processing strategy changed to 'simple_full_document' - RAG processor available as alternative strategy 'document_ai_agentic_rag' ## Files Changed - 36 files changed, 5642 insertions(+), 4451 deletions(-) - Removed deprecated documentation files - Cleaned up unused services and models This release represents a major refactoring focused on speed, accuracy, and maintainability.
52 lines
1.2 KiB
SQL
52 lines
1.2 KiB
SQL
-- Create jobs for all documents stuck in processing_llm status
|
|
-- This will find all stuck documents and create jobs for them
|
|
|
|
-- First, find all stuck documents
|
|
SELECT
|
|
id,
|
|
user_id,
|
|
status,
|
|
original_file_name,
|
|
updated_at
|
|
FROM documents
|
|
WHERE status = 'processing_llm'
|
|
ORDER BY updated_at ASC;
|
|
|
|
-- Then create jobs for each document (replace DOCUMENT_ID and USER_ID)
|
|
-- Run this for each document found above:
|
|
|
|
INSERT INTO processing_jobs (
|
|
document_id,
|
|
user_id,
|
|
status,
|
|
attempts,
|
|
max_attempts,
|
|
options,
|
|
created_at
|
|
)
|
|
SELECT
|
|
id as document_id,
|
|
user_id,
|
|
'pending' as status,
|
|
0 as attempts,
|
|
3 as max_attempts,
|
|
'{"strategy": "document_ai_agentic_rag"}'::jsonb as options,
|
|
NOW() as created_at
|
|
FROM documents
|
|
WHERE status = 'processing_llm'
|
|
AND id NOT IN (SELECT document_id FROM processing_jobs WHERE status IN ('pending', 'processing', 'retrying'))
|
|
RETURNING id, document_id, status, created_at;
|
|
|
|
-- Verify jobs were created
|
|
SELECT
|
|
pj.id as job_id,
|
|
pj.document_id,
|
|
pj.status as job_status,
|
|
d.original_file_name,
|
|
pj.created_at
|
|
FROM processing_jobs pj
|
|
JOIN documents d ON d.id = pj.document_id
|
|
WHERE pj.status = 'pending'
|
|
ORDER BY pj.created_at DESC;
|
|
|