Ollama and LangChain: vectorless financial RAG tutorial
Learn tree-based retrieval without a vector database using Gemma 3 4B, Markdown headings and three queries against an Nvidia financial statement.
Player not loading? Watch on YouTube
Venelin Valkov walks through a financial RAG implementation that uses document structure instead of embeddings and a vector database. The tutorial pairs Ollama and LangChain with Gemma 3's 4 billion parameter model to build the system locally.
The input is a Markdown extraction of an Nvidia financial statement that preserves headings and tables. LangChain's Markdown header text splitter separates sections into a tree. Each node holds its text, title, ID and summary. The model builds summaries from the leaves upward, then uses those summaries to choose relevant nodes for a question. A separate prompt generates the answer from the selected text.
The demonstration tests questions about Q3 revenue and earnings per share, AI infrastructure partnerships, and the Q4 outlook. Valkov inspects the selected sections and compares answers with the source document. These examples show the workflow on one filing rather than establish accuracy across financial documents.
Valkov recommends considering this approach for small collections of structured documents. He warns that summarization and retrieval require extra model calls, summary quality affects results, and limited context windows constrain scale. For thousands of documents, he expects conventional vector search to be faster. The complete tutorial and source code require MLExpert Pro.