MathModel-QA-Engine
A retrieval-augmented generation engine built with LlamaIndex for querying past MCM/ICM mathematical-modeling competition papers, chunking each paper by its heading structure into whole-section nodes tagged by year, problem and section for precise, filtered retrieval.
MathModel-QA-Engine is a RAG question-answering engine for analyzing winning papers from mathematical-modeling competitions such as MCM/ICM, built with LlamaIndex. Because these papers follow a highly uniform structure, Summary, Introduction, Assumptions, Body, Sensitivity Analysis, Conclusion, the project chunks each paper by its Markdown heading rather than by a fixed token length, splitting further only when a section under one heading is too long, so each retrieval node is a semantically complete section.
A regex state machine automatically recognizes 13 section types during chunking; each retrieval node carries metadata such as year, problem number, section and document ID, so retrieval can be filtered along any combination of those fields, including comparing how the same problem type was handled across different years. Multi-turn chat keeps conversation memory so answers get more precise the deeper the conversation goes, and post-processing filters out title-only and table-of-contents nodes to reduce retrieval noise.
Built with Python and LlamaIndex, with a command-line interface to build the vector index and chat, and support for any OpenAI-compatible embedding and chat API, including OpenAI, DeepSeek and Zhipu. MIT licensed.