AI-powered scientific retrieval platform for optical turbulence research and free-space optical (FSO) communication experiments.
Scientific RAG Lab is a modular Retrieval-Augmented Generation (RAG) system designed for scientific document ingestion, semantic retrieval, and AI-assisted exploration of optical turbulence research.
The project combines:
- local Large Language Models (LLMs)
- vector databases
- semantic embeddings
- scientific document ingestion
- asynchronous AI workflows
- retrieval pipelines
into a scalable architecture capable of transforming scientific PDFs and experimental artifacts into a searchable AI-ready knowledge system.
The current implementation focuses on local-first AI infrastructure using:
- Ollama
- Qdrant
- FastAPI
- LlamaIndex
- Inngest
Current capabilities include:
- PDF upload through a web interface
- automatic ingestion pipeline
- semantic chunking
- embedding generation
- vector storage with Qdrant
- semantic similarity search
- AI-generated answers using local LLMs
- asynchronous ingestion workflows with Inngest
- chat interface for querying scientific papers
┌────────────────────┐
│ Scientific PDFs │
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ Ingestion Pipeline │
└─────────┬──────────┘
│
┌─────────▼──────────┐
│ Document Chunking │
└─────────┬──────────┘
│
┌─────────▼──────────┐
│ Semantic Embedding │
└─────────┬──────────┘
│
┌─────────▼──────────┐
│ Qdrant Vector DB │
└─────────┬──────────┘
│
┌─────────▼──────────┐
│ Semantic Retrieval │
└─────────┬──────────┘
│
┌─────────▼──────────┐
│ Local LLM Reasoner │
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ Scientific Assistant│
└────────────────────┘
- Python
- FastAPI
- Ollama
- Qdrant
- Inngest
- LlamaIndex
- Pydantic
- Docker
- Retrieval-Augmented Generation (RAG)
- semantic embeddings
- vector similarity search
- local LLM inference
- scientific semantic retrieval
scientific-rag-lab/
│
├── knowledge/ # Markdown notes about RAG, Ollama, Qdrant, LlamaIndex and Inngest
│ ├── rag/
│ ├── ollama/
│ ├── qdrant/
│ ├── llamaindex/
│ └── inngest/
│
├── src/
│ ├── core/ # Application configuration
│ │ └── config.py
│ │
│ ├── frontend/ # Static web interface
│ │ ├── index.html
│ │ ├── styles.css
│ │ └── app.js
│ │
│ ├── ingestion/ # PDF ingestion, embeddings and answer generation
│ │ ├── data_loader.py
│ │ ├── embedder.py
│ │ ├── generator.py
│ │ └── pipeline.py
│ │
│ ├── models/ # Pydantic schemas
│ │ ├── ingestion.py
│ │ ├── retrieval.py
│ │ └── vector_store.py
│ │
│ ├── vector_database/ # Qdrant client wrapper
│ │ └── vector_db.py
│ │
│ ├── workers/ # Inngest client and workflow functions
│ │ ├── inngest_client.py
│ │ └── inngest_functions.py
│ │
│ └── main.py # FastAPI application entry point
│
├── .env.example # Example environment variables
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt
---
# Setup
## 1. Clone the repository
```bash
git clone <repository-url>
cd scientific-rag-lab
python -m venv env
.\env\Scripts\Activate.ps1python -m venv env
source env/bin/activatepip install -r requirements.txtCreate a .env file in the project root.
Example:
# =========================================
# Ollama
# =========================================
OLLAMA_BASE_URL=http://localhost:11434
# =========================================
# Models
# =========================================
LLM_MODEL=qwen2.5:7b
EMBED_MODEL=bge-m3
# =========================================
# Qdrant
# =========================================
QDRANT_HOST=localhost
QDRANT_PORT=6333
QDRANT_COLLECTION=documents
# =========================================
# Chunking
# =========================================
CHUNK_SIZE=1024
CHUNK_OVERLAP=128
# =========================================
# Inngest
# =========================================
INNGEST_APP_ID=scientific-rag-lab
INNGEST_IS_PRODUCTION=false
INNGEST_LOGGER=uvicornMake sure Docker Desktop is running.
docker run -d \
--name scientific-rag-qdrant \
-p 6333:6333 \
-v "$(pwd)/vector_database:/qdrant/storage" \
qdrant/qdrantdocker run -d `
--name scientific-rag-qdrant `
-p 6333:6333 `
-v "${PWD}/vector_database:/qdrant/storage" `
qdrant/qdrantQdrant dashboard:
http://localhost:6333/dashboard
Start Ollama locally:
ollama servePull required models:
ollama pull qwen2.5:7b
ollama pull bge-m3Start FastAPI:
uvicorn src.main:app --reloadApplication:
http://127.0.0.1:8000
npx inngest-cli@latest dev -u http://127.0.0.1:8000/api/inngest --no-discoveryInngest dashboard:
http://127.0.0.1:8288
Open:
http://127.0.0.1:8000
Upload a scientific paper through the web interface.
The system will automatically:
- ingest the document
- split it into chunks
- generate embeddings
- store vectors in Qdrant
Ask questions directly through the chat interface.
Example queries:
What is this paper about?
Summarize the conclusions.
What turbulence metrics are analyzed?
Explain the experimental setup.
What is the role of the Fried parameter?
This project is part of a broader research effort focused on:
- optical turbulence characterization
- free-space optical communications
- AI-assisted scientific analysis
- data-centric turbulence modeling
- semantic scientific retrieval
- multimodal scientific AI systems
The long-term objective is to investigate how modern AI systems can assist scientific experimentation by transforming raw experimental artifacts into searchable and semantically connected knowledge.
Planned future features include:
- multimodal retrieval
- image embeddings
- experiment similarity search
- scientific agents
- metadata filtering
- hybrid search
- reranking
- conversational memory
- streaming responses
- distributed vector storage
- evaluation pipelines
- observability and tracing
- scientific knowledge graphs
🚧 Active development
Current version includes a fully functional local scientific RAG pipeline with:
- PDF ingestion
- vector search
- local embeddings
- local LLM answering
- asynchronous workflows
- web chat interface