Manuscript Offprint

arXiv:2610.39230

Beyond LLM Wrappers: Context Engineering and the Three-Engine Architecture for Reliable Financial AI

Pradeep Kumar GS, Ravi Tanniru

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Financial AI systems are increasingly expected to answer operational questions that are not merely informational, but decision-bearing: which vendors should be paid this week, which customers should be escalated for collection, which invoices are exposed to tax risk, what cash position is likely under a delayed-receivables scenario, and why a working-capital metric changed. These questions require natural language interaction, but they also require deterministic computation, persistent business context, source traceability, and auditable recommendations. A large language model (LLM) by itself cannot satisfy those requirements. It can interpret language and produce explanations, but it does not provide a reliable memory of financial relationships, does not guarantee reproducible calculations, and can generate plausible but unsupported claims. Conversely, knowledge graphs, optimization solvers, and rules engines each provide important capabilities, but none provides the complete user-facing experience required by finance teams.

This paper presents a production-grounded architecture for reliable financial AI based on three engines: a financial knowledge graph, a deterministic optimization engine, and a multi-agent LLM layer. The knowledge graph stores enterprise financial context, relationships, provenance, and temporal state. The optimization engine performs reproducible calculations for payment scheduling, cash allocation, vendor prioritization, discount capture, and similar decision tasks. The multi-agent LLM layer interprets user intent, formulates tasks, assembles explanations, and validates generated claims against structured ground truth. The central contribution is not merely the use of these engines, but the coordination layer that connects them. We call this layer context engineering: the process of selecting, ranking, composing, validating, and budgeting the context required for each financial query across heterogeneous data sources, tools, tenants, and decision objectives.

Drawing from 15 production deployments over approximately 11 months, this paper reports several observations. First, single-agent LLM pipelines produced unacceptable hallucination rates (approximately 7–9%, ranging 5–10% by query type) for financial recommendations, including fabricated invoices, invented discounts, incorrect totals, and unsupported vendor claims. Second, graph-backed multi-agent validation reduced observed hallucinations to below 1% in production usage, although the evidence is observational rather than randomized. Third, ERP data quality and tenant heterogeneity dominated implementation effort: inconsistent vendor names, missing fields, duplicate entities, free-text terms, and industry-specific schemas required substantial normalization before AI reasoning could be trusted. Fourth, deployment time fell from roughly six weeks to approximately two weeks as reusable ERP mappings, graph templates, validation patterns, and compliance-specific context policies accumulated.

The paper argues that financial context engineering is distinct from standard retrieval-augmented generation. Financial systems must retrieve structured relationships rather than only text chunks, respect temporal validity, include exact numerical evidence, enforce access control, adapt to tenant-specific schemas, and validate claims against source records and solver outputs. We position context engineering as a research problem for high-stakes structured domains and identify open problems in evaluation, reproducibility, privacy, benchmark design, context quality metrics, and cross-tenant pattern learning.

Keywords: financial AI, context engineering, knowledge graphs, multi-agent systems, deterministic optimization, audit trails, retrieval-augmented generation, working capital, ERP integration

1. Introduction

Finance work is full of questions that look simple in natural language and complex in execution. A controller may ask, "Which vendors should we prioritize for payment this week?" A CFO may ask, "What happens to cash if our largest customer delays payment by ten days?" An accounts payable manager may ask, "Why did aging in the 60-day bucket increase this month?" A tax reviewer may ask, "Which invoices are exposed to GST mismatch risk?" Each question requires a fluent answer, but the answer is only useful if it is grounded in source records, reflects current financial state, respects business constraints, and can be audited after the decision is made.

This is the core difficulty for financial AI. The interface problem and the reasoning problem are different. Natural language is the desired interface because finance users should not need to write SQL, Cypher, optimization code, or ERP-specific queries. Yet the underlying decision must be derived from invoices, payments, contracts, tax codes, bank balances, purchase orders, customer terms, vendor relationships, and historical behavior. The system must map a conversational question to structured evidence, perform deterministic calculations where necessary, explain the result in business terms, and preserve a trace that another person can inspect.

LLMs are strong at language understanding, summarization, and interactive explanation, but financial AI cannot be built as a thin wrapper around an LLM. The discount must actually exist. The cash position must come from a source system. Calculations must be reproducible. In financial systems, a hallucination has operational shape—a nonexistent invoice number, an invented payment term, a misidentified vendor, or a recommendation that violates a cash constraint—and a response that is 95% correct may still be unacceptable if the remaining 5% contains the vendor, amount, or date that drives the decision. Traditional deterministic systems—ERP reports, rules engines, optimization solvers—face the opposite limitation: exact but rigid, requiring users to know where to look and how to interpret exceptions. The problem is not choosing one engine. The problem is composing engines so that each performs the role for which it is suited.

This paper proposes a three-engine architecture for reliable financial AI. The first engine is a financial knowledge graph. It functions as enterprise memory: a structured, temporal, provenance-bearing representation of financial entities and relationships. The second engine is a deterministic optimization layer. It performs calculations and constrained decision-making for payment schedules, cash allocation, discount capture, collections prioritization, and similar tasks. The third engine is a multi-agent LLM layer. It handles language, intent, task formulation, explanation, and validation orchestration. These engines are coordinated by context engineering, a layer that determines what evidence, graph substructures, solver outputs, tenant settings, and validation checks should be assembled for each query.

The term context engineering is used deliberately. Standard retrieval-augmented generation (RAG) generally retrieves text chunks that are semantically similar to a question and supplies them to a model. Financial AI needs more than similarity. It needs structured traversal, entity resolution, temporal filtering, context budgeting, validation, tenant-specific interpretation, and deterministic tool invocation. If a user asks whether to pay Vendor A now or next week, the relevant context may include unpaid invoices, cash balances, discount windows, vendor criticality, tax obligations, purchase order status, historical payment behavior, and policy constraints. Some of that context is text, some is structured data, some is computed output, and some is a validation trace. Context engineering is the process of turning that heterogeneous evidence into the right model input and the right audit output.

The production motivation for this work comes from 15 production deployments spanning approximately 11 months. The deployed settings span manufacturing, SaaS, services, e-commerce, and trading businesses, with ERP integrations including Zoho, Tally, QuickBooks, and Acumatica. These environments are messy in ways that matter: vendor names are inconsistent, payment terms are free text, source records are incomplete, tenant definitions vary by industry, and financial workflows mix deterministic rules with judgment. These deployments showed that the most difficult part of financial AI was not prompting a model. It was constructing enough trusted context for the model, solver, and graph to work together.

The framing is intentionally operational rather than speculative. Many discussions of AI in finance focus on model capability: whether an LLM can read a statement, summarize a filing, or answer questions about a policy document. Those tasks matter, but they do not capture the pressure of day-to-day finance operations. Operational finance decisions are time-sensitive, cross-system, and consequence-bearing. A delayed payment can damage a supplier relationship. A missed discount can create measurable cash leakage. A wrong tax classification can trigger review. A stale receivables assumption can distort a cash forecast. For these tasks, the system must know not only what words mean, but what records are current, which constraints bind, which exceptions matter, and how to justify a recommendation after the fact.

This paper therefore treats financial AI as decision infrastructure. The unit of analysis is not a prompt-response pair. It is the full path from user intent to source records, context assembly, deterministic computation, validation, explanation, and audit. That path determines whether an AI system is usable by finance teams. A model may be powerful, but if it receives stale context, it will produce stale answers. A graph may be complete, but if the system retrieves the wrong subgraph, the answer will omit critical constraints. A solver may be exact, but if the LLM formulates the wrong objective, the result will optimize the wrong business problem. Context engineering is the discipline that makes these dependencies explicit.

Section 2 analyzes the requirements for reliable financial AI. Section 3 describes the three-engine architecture. Section 4 defines context engineering and explains why it differs from standard RAG. Section 5 discusses integration challenges. Section 6 summarizes production deployment observations. Section 7 positions the work relative to LLMs, knowledge graphs, optimization, multi-agent systems, and RAG. Section 8 presents limitations. Section 9 concludes with open research directions.