# A Private AI Research Desk for Traders

> A self-hosted AI research platform that searches a trader's private documents and videos, provides source citations, reads chart information, and runs trading strategy backtests.

Section: Custom SaaS Platforms

Page: https://mburhan.com/case/a-private-ai-research-desk-for-traders

## Overview

This project delivers a private AI assistant for an active trader working with ICT trading concepts. It combines document and video search, AI-powered answers, chart analysis, and a Python backtesting engine in one platform. The system runs on the client's own VPS, keeping their data, infrastructure, and operating costs under their control.

## The Problem

The client's trading knowledge was spread across hundreds of hours of mentorship videos, PDFs, Pine Script references, and price-data spreadsheets. Finding specific explanations required manually searching through documents and videos, while testing strategies meant writing code from scratch.

General-purpose AI assistants were not reliable enough because they could mix outside information with the client's material or provide incorrect chart prices with confidence. The client needed a private system that could provide source-backed answers and perform real backtests using their own data.

## How It Works

1. **Private AI Chat:** Open WebUI provides a secure chat interface, with Caddy handling HTTPS and LiteLLM connecting the AI models.
2. **Document Processing:** The FastAPI and Haystack services extract content from uploaded documents, divide it into searchable sections, generate embeddings, and store them in Qdrant.
3. **Video Processing:** Videos are downloaded, transcribed, and analyzed using keyframes, OCR, and visual descriptions. The extracted information is indexed so users can search for specific explanations and chart moments.
4. **Intelligent Retrieval:** The platform combines keyword and semantic search, reranks results, and filters out low-confidence matches. A query planner also rewrites natural-language questions into clearer search queries.
5. **Source-Based Answers:** The AI answers using retrieved client materials and provides document-page or video-timestamp citations. Uncertain chart prices are marked rather than presented as confirmed values.
6. **Trading Backtesting:** An isolated Python environment runs strategy backtests, parameter sweeps, indicators, ICT pattern detection, performance metrics, and chart exports.
7. **Administration and Monitoring:** A Streamlit dashboard manages uploads, video processing, storage, costs, and restoration. Phoenix tracing and encrypted backups support monitoring and recovery.

Image (https://mburhan.com/uploads/27e2e294598dcbf2be2f81f8.png)

## The Result

The platform provides the client with a private workspace to search trading knowledge, review source materials, and test strategies. It also supports a shared knowledge base across different user accounts, allowing authorized users to access relevant documents and videos. By connecting AI-powered research with an isolated backtesting environment, the system keeps the client's data and infrastructure under their control.

Image (https://mburhan.com/uploads/97d1a3d7a0a1f53ea8fbd0c5.png)

Image (https://mburhan.com/uploads/c48f9ade43bd3b27c8d15d57.png)

Image (https://mburhan.com/uploads/951db2800ed16a31d86124bc.png)

## Tech Stack

- **Open WebUI:** Provides the private AI chat interface.
- **LiteLLM:** Connects and manages AI models, including Gemini Flash.
- **FastAPI and Haystack:** Handle document processing, retrieval, and RAG services.
- **Qdrant:** Stores document and video embeddings for search.
- **PostgreSQL:** Stores application state and related data.
- **Apache Tika:** Extracts content from documents.
- **Voyage AI:** Provides embeddings and reranking.
- **Groq ASR:** Supports speech-to-text processing.
- **OCR and Vision Models:** Extract and describe information from video frames and charts.
- **Python:** Runs the trading backtesting engine and analysis tools.
- **Streamlit:** Provides the administration dashboard.
- **Docker Compose and Caddy:** Manage self-hosted services and HTTPS.
- **Phoenix / OpenTelemetry:** Support tracing and monitoring.
- **restic and rclone:** Handle encrypted backups and storage transfers.

### Where This Pattern Applies

- Trading Firms: Search internal research, trading strategies, and market education materials.
- Investment Research Teams: Retrieve information from private reports, documents, and recorded discussions.
- Financial Educators: Make large libraries of training videos and learning materials searchable.
- Quantitative Analysts: Combine AI-assisted research with automated backtesting and strategy evaluation.
- Agriculture: Help farmers and agricultural organizations search farming guides, crop research, soil reports, weather records, and agricultural training materials.
- Healthcare: Help medical research teams retrieve information from clinical studies, medical documents, and educational resources.
- Education: Make institutional learning materials, lectures, research papers, and training content searchable.
- Manufacturing: Provide AI-powered access to equipment manuals, maintenance records, technical documentation, and operational procedures.
- Research Organizations: Build private AI assistants grounded in internal documents and datasets.

This pattern can be applied across industries wherever organizations have large collections of private information. By combining a shared knowledge base, AI-powered search, source-backed answers, and specialized analysis tools, organizations can turn their existing data into a searchable and useful research assistant while keeping control of their infrastructure.
