A research-grounded Financial RAG system based on the QuantMind architecture.
┌─────────────────────────────────────────────────────────────────┐
│ QUANTMIND RAG SYSTEM │
├─────────────────────────────────────────────────────────────────┤
│ │
│ STAGE 1: KNOWLEDGE EXTRACTION │
│ ┌──────────┐ → ┌──────────┐ → ┌──────────┐ → ┌──────────┐ │
│ │ Parse │ │Summarize │ │ Tag │ │ Store │ │
│ │(multimodal) │(adaptive) │ │(domain) │ │(vectors) │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ STAGE 2: INTELLIGENT RETRIEVAL │
│ ┌──────────┐ → ┌──────────┐ → ┌──────────┐ → ┌──────────┐ │
│ │ Query │ │ Retrieve │ │ Reason │ │ Generate │ │
│ │ Parse │ │(adaptive) │ │(multi-hop)│ │(knowledge)│ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
quantmind_rag/
├── src/
│ ├── models/ # Data models
│ │ ├── __init__.py
│ │ ├── document.py # Document, Chunk, Entity models
│ │ └── query.py # Query, Response models
│ │
│ ├── extraction/ # Stage 1: Knowledge Extraction
│ │ ├── __init__.py
│ │ ├── parser.py # Multi-modal parser
│ │ ├── summarizer.py # Adaptive summarization
│ │ └── tagger.py # Domain-specialized tagging
│ │
│ ├── retrieval/ # Stage 2: Intelligent Retrieval
│ │ ├── __init__.py
│ │ ├── retriever.py # Adaptive retrieval strategies
│ │ ├── reasoner.py # Multi-hop reasoning
│ │ └── generator.py # Knowledge-aware generation
│ │
│ ├── storage/ # Data storage layer
│ │ ├── __init__.py
│ │ ├── vector_store.py # Vector database interface
│ │ ├── graph_store.py # Knowledge graph storage
│ │ └── doc_store.py # Document storage
│ │
│ ├── verification/ # Hallucination mitigation
│ │ ├── __init__.py
│ │ └── verifier.py # Claim verification
│ │
│ └── api/ # API layer
│ ├── __init__.py
│ └── routes.py # FastAPI endpoints
│
├── config/
│ └── settings.py # Configuration
│
├── main.py # Application entry point
├── requirements.txt # Dependencies
└── README.md
# Install dependencies
pip install -r requirements.txt
# Run the API server
python main.py
# Or use the pipeline directly
python -c "from src.pipeline import QuantMindPipeline; p = QuantMindPipeline()"Based on:
- QuantMind: Two-stage decoupled architecture (extraction + retrieval)
- FinReflectKG: Knowledge graph for 24% accuracy improvement
- InterpDetect: Hallucination detection via ECS/PKS scores
- TS-Agent: Feedback loops and memory for continuous improvement