Astrophysics publishes more than any researcher can read. This service ingests arXiv papers, parses the full PDFs with Docling, and answers questions with citations back to the source: Airflow for monthly ingestion, FastAPI and Gradio on top, and OpenSearch, Postgres, Redis, MinIO, Ollama and Langfuse running in Docker Compose.
The one real design decision was hybrid retrieval. Keyword search misses paraphrases; vector search misses exact identifiers and terminology, which is most of scientific text. Both live in a single OpenSearch index — BM25 alongside HNSW over 768-dimension nomic-embed-text vectors — fused with reciprocal rank fusion. If the embedding service fails at query time, the API falls back to BM25 instead of erroring.
Generation runs on a local 1B-parameter model constrained to the retrieved excerpts, with citations required and uncertainty allowed. Every request is traced in Langfuse, so a bad answer can be traced to retrieval or to the model. The gap I am honest about: there is no retrieval benchmark yet — no gold question set, so recall and citation precision are not measured. Building that harness is the next step.
Read the full analysis GitHub