AI-Powered Spreadsheet & Document Analysis with Multi-Agent Orchestration and Cross-Document Reference
An enterprise data team needed to analyze, query, and edit large collections of spreadsheets and documents (Excel, CSV, Google Sheets, PDFs, Word docs) using natural language โ with the ability to cross-reference data across multiple files and execute multi-step analytical workflows without manual data wrangling.
Pag-usapan ang Iyong Proyekto
Ang Hamon
Working with business documents at scale was riddled with friction:
- Siloed Data โ Critical information was scattered across dozens of spreadsheets, PDFs, and Word documents with no way to query across them
- Manual Cross-Referencing โ Comparing a vendor price list (Excel) against contract terms (PDF) against invoice history (CSV) required hours of manual lookup
- Formula Limitations โ Complex analytical questions couldn't be answered with spreadsheet formulas alone
- Context Window Limits โ Large spreadsheets (50,000+ rows) exceeded LLM context windows, making naive approaches fail
- No Edit Capabilities โ Existing AI tools could analyze documents but couldn't write changes back to the source files
- Multi-Step Reasoning โ Questions requiring sequential analysis across documents needed orchestrated multi-step workflows
Ang Aming Solusyon
We built a multi-agent AI document intelligence platform with vector database-backed retrieval for large documents, specialized agents for different document types, an orchestrator for cross-document reasoning, and write-back capabilities for spreadsheet editing.
Architecture
- Orchestrator: AI orchestrator agent coordinating multi-step workflows across specialized agents
- Spreadsheet Agent: Handles Excel/CSV/Google Sheets analysis, formula generation, and cell edits
- Document Agent: Handles PDF/Word document reading, extraction, and summarization
- Cross-Reference Agent: Performs joins, comparisons, and reconciliation across document types
- Vector Database: Milvus for semantic indexing of document chunks and spreadsheet rows
- LLM Layer: Multi-model approach with function calling
- Backend: Python/FastAPI for document processing and agent orchestration
- Frontend: React dashboard with file upload, chat interface, and live spreadsheet preview
- Storage: S3 for original files, PostgreSQL for metadata and job tracking
Multi-Agent Architecture
Agent Roles
1. Orchestrator AgentThe central coordinator that receives user queries, decomposes them into sub-tasks, and delegates to specialized agents. It analyzes user intent, creates execution plans, manages data flow between agents, aggregates results, and handles error recovery.
2. Spreadsheet AgentSpecialized for tabular data operations including schema understanding, natural language to query translation, aggregations and filtering, formula generation, cell editing and column fills, chart suggestions, and data validation/anomaly detection.
3. Document AgentSpecialized for unstructured and semi-structured documents including OCR and layout-aware text extraction, section identification, key-value extraction from contracts, summarization, semantic clause search, and table extraction from PDFs/Word docs.
4. Cross-Reference AgentSpecialized for multi-document reasoning including entity matching across documents, data reconciliation and discrepancy identification, timeline analysis, dependency resolution for conflicting data, and SQL-like join operations across document types.
Vector Database Layer
Why Vector DB for Documents
Large documents and spreadsheets can't fit in a single LLM context window. The vector database enables semantic search across millions of rows and document chunks, retrieval of only relevant portions per query, cross-document entity linking via embedding similarity, and persistent indexing that doesn't need re-processing on every query.
Indexing Strategy
Spreadsheet Indexing:Each row is converted to a natural language representation by concatenating key column values, then embedded and stored with references back to the original file, sheet, and row index for write-back operations.
Document Indexing:Documents are extracted with layout awareness, chunked into semantic segments with overlap, embedded, and stored with references to the source file, section, and page number.
Cross-Document Entity Index:A separate index links entities (vendors, products, people, invoice numbers) across documents, enabling cross-reference queries to quickly find all mentions of an entity regardless of source file.
Retrieval Pipeline
When a user asks a cross-document question, the orchestrator identifies which documents and agents are needed, performs vector searches to find relevant data across all sources, delegates to specialized agents for processing, and aggregates results into a coherent response.
Orchestration Engine
Query Decomposition
The orchestrator breaks complex queries into multi-step execution plans. For example, a question like "Find vendors with late deliveries, check contract penalty clauses, and calculate claimable penalties" would be decomposed into sequential steps: querying delivery data via the Spreadsheet Agent, searching contracts via the Document Agent, and joining results via the Cross-Reference Agent.
Agent Communication
- Agents communicate via structured messages with typed payloads
- The orchestrator maintains execution context with intermediate results
- Failed steps trigger retry or fallback strategies
- Partial results are returned if some steps complete but others fail
Spreadsheet Edit & Write-Back
Edit Capabilities
The platform supports cell updates, column fills, row insertion, conditional formatting, new sheet creation, and formula injection โ all proposed by AI agents and applied with user approval.
Write-Back Pipeline
- Agent determines the edit operation (which cells, what values)
- Edit preview shown to user with diff highlighting (old vs. new values)
- User approves or modifies the proposed changes
- Backend applies changes to the file using appropriate libraries per format
- Modified file saved as a new version with edit audit trail
- Vector index updated for changed rows
Version Control
- Every edit creates a new file version (original preserved)
- Diff log shows exactly what changed, when, and why
- Rollback to any previous version with one click
- Edit attribution: which agent or user made each change
Processing Pipeline for New Documents
File Upload Flow
- User uploads files (drag-and-drop or API)
- File type detected and routed to appropriate processor
- Spreadsheets: Parsed, schema inferred, rows embedded and indexed
- PDFs: OCR (if scanned) โ layout extraction โ chunking โ embedding โ indexing
- Word Docs: Text extraction โ section parsing โ chunking โ embedding โ indexing
- Entity Extraction: NER identifies people, organizations, dates, amounts across all docs
- Cross-Document Linking: Entity index updated with new mentions
- File metadata stored in PostgreSQL, embeddings in vector DB, originals in S3
Supported Formats
The platform supports Excel, CSV, and Google Sheets (with full write-back), native and scanned PDFs (read-only), and Word docs and Google Docs (limited write-back).
Key Features
- Multi-Agent Architecture โ Specialized agents for spreadsheets, documents, and cross-referencing
- AI Orchestrator โ Decomposes complex queries into multi-step execution plans
- Cross-Document Reference โ Entity linking and data reconciliation across file types
- Vector-Powered Retrieval โ Semantic search handles datasets beyond LLM context limits
- Spreadsheet Write-Back โ AI edits cells, fills columns, and injects formulas with user approval
- Large Dataset Support โ 50,000+ row spreadsheets indexed and queryable via vector search
- Version Control โ Every edit versioned with diff log and rollback capability
- Natural Language Queries โ Ask complex analytical questions in plain English
- Multi-Format Support โ Excel, CSV, Google Sheets, PDF, Word, Google Docs
- Edit Preview โ Diff-highlighted preview before any changes are applied
Mga Resulta
Technology Stack
caseStudyDetail.more Mga Case Study
Tuklasin ang higit pa sa aming mga teknikal na implementasyon
Lokal-Una na Sistema ng RAG ng Dokumento na may Hybrid Search at Suporta sa Maraming Format
Isang pangkat na bumubuo ng mga tool para sa developer ang nangailangan ng isang ganap na lokal, pang-seguridad sa privacy na sistema ng document intelligence na kayang kumain ng maraming format ng file, bumuo ng mga mahahanap na knowledge base, at sumagot sa mga natural na wika na query gamit ang Retrieval-Augmented Generation (RAG) โ nang hindi nagpapadala ng anumang data sa mga external na API.
Pagpoproseso ng Invoice na Pinapagana ng AI gamit ang OCR at Integrasyon ng QuickBooks
Isang katamtamang laking negosyo na nagpoproseso ng daan-daang invoice ng vendor buwan-buwan ang kinailangan alisin ang manu-manong pagpasok ng data sa pamamagitan ng awtomatikong pagkuha ng data ng invoice gamit ang AI/OCR at direktang i-sync ito sa QuickBooks para sa bookkeeping at pagsubaybay sa pagbabayad.
Handa nang Baguhin ang Iyong Negosyo?
Pag-usapan natin kung paano namin mailalapat ang katulad na mga solusyon sa iyong mga hamon.