CruxBit
Back to catalog
MediumTechnologyfinance

Natural Language to SQL Query Assistant for Financial Databases

Added Jun 2025 3 design docs

Inside most finance teams, data access has a human bottleneck: analysts who know SQL field a constant stream of requests such as revenue by region last quarter or accounts with unusual transaction volume, while the managers asking must wait days for answers that take minutes to compute. Letting business users ask questions in plain English and receive database-backed answers removes that bottleneck without teaching everyone SQL.

The intern builds this assistant for financial data as a Python FastAPI service. LangChain's SQL tooling provides the core machinery: the user's natural-language question is combined with the database schema and passed to OpenAI models, which generate a candidate SQL query; the service executes it against the financial database and returns both the results and a plain-language explanation of what was computed. The intern implements the schema-awareness layer, validation that inspects generated SQL before execution to block destructive or runaway queries, error recovery when generation fails, and response formatting that presents figures clearly with the underlying query visible for audit.

The project demonstrates one of the most requested applied-AI capabilities in business settings: text-to-SQL with safety rails, sound API design in FastAPI, and the engineering skepticism required when letting a language model write code that touches financial data.

Related projects

You might also like

TechnologyEasy

Plain-Language Database Query App for Finance Beginners

Databases hold the answers to most quantitative questions people ask at work and in class, but SQL stands between those questions and their answers. Finance students learning to analyze data, and non-technical users staring at a transactions table, give up not because the question is hard but because the query syntax is. An app that accepts the question in plain English and handles the SQL invisibly turns a database from an obstacle into a resource. The intern builds this app as a Streamlit project in Python using LangChain's SQL capabilities. Connected to a sample database, such as financial transactions or budget records, the app takes a natural-language question, uses the language model to generate the corresponding SQL query against the known schema, executes it, and presents the results along with the generated SQL so users can learn from what was produced. The intern implements the database connection, the question-to-query chain, result rendering in readable tables, and basic guards that prevent destructive statements from executing. The project introduces text-to-SQL, one of the most practically demanded LLM applications, at a scale an early developer can master fully: the intern learns schema-aware prompting, query validation habits, and interface design that treats generated code as something to display and verify, not blindly trust.

educationfinancegenerative-ailangchainpython+1
PRD · HLD · LLD includedView
TechnologyEasy

Lightweight Text Generation API Built With LangServe

The gap between a working LangChain script and a service other software can call is deployment, and LangServe exists to close it: it turns chains into REST APIs with typed endpoints, streaming, and an interactive playground almost for free. Knowing this path from notebook to network service is essential for any developer who wants their AI work used by anyone other than themselves, and this project walks it end to end at a friendly scale. The intern builds a FastAPI project in Python that exposes a text generation chain through LangServe. The intern first constructs the chain itself with LangChain, a prompt template feeding a language model with configurable parameters such as topic and style, then mounts it as a LangServe route, gaining automatically generated endpoints for invocation, batching, and streaming. Around this core the intern adds a health check, request logging, and clear API documentation, then exercises the service from the built-in playground and from an external client script to prove the full round trip works. The project teaches deployment fundamentals for LLM applications: how chains become HTTP services, how FastAPI and LangServe divide responsibilities, what streaming responses look like on the wire, and how to structure a small AI service so that adding the next endpoint is easy, foundations the intern will reuse in every production AI role.

educationfastapigenerative-ailangchain+1
PRD · HLD · LLD includedView
TechnologyMedium

Knowledge Retrieval Service for Energy Sector Documents on Vertex AI

Energy companies manage some of the densest documentation in industry: grid compliance filings, environmental impact assessments, turbine maintenance manuals, and regulatory correspondence spanning decades. Engineers and analysts lose hours locating provisions inside these archives, and institutional knowledge walks out the door with every retirement. A retrieval system that answers plain-language questions from this corpus, hosted on infrastructure the company already trusts, addresses both problems at once. The intern builds this knowledge retrieval service as a cloud-based application on Google Cloud's Vertex AI. Documents are processed and embedded into a vector index, and a Python pipeline built with LangChain performs retrieval-augmented generation: fetching the passages relevant to a query and composing answers through OpenAI and Vertex AI models with citations back to the source documents. The intern implements the document processing workflow, the retrieval configuration tuned for long technical documents, and the query API through which analysts interact with the system, all deployed and running on GCP services. The project demonstrates cloud-native AI engineering: building RAG on a managed ML platform, handling industrial document collections, and delivering grounded question answering with the citation discipline that regulated sectors require.

energygcpgenerative-ailangchain+2
PRD · HLD · LLD includedView