You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,31 @@
1
-
# Dealer RAG API
1
+
# Thought-Processor
2
2
3
-
A modern, interview-ready, and production-grade Retrieval-Augmented Generation (RAG) backend. This project provides a robust API to ingest PDF documents containing text and tables, process them asynchronously, and query them using state-of-the-art Large Language Models (LLMs) with conversational memory.
3
+
> "A production-grade RAG backend that takes complex PDF manuals as input and asynchronously provisions highly-accurate, conversational AI answers."
4
+
5
+
## Architecture
6
+
7
+
```mermaid
8
+
graph TD
9
+
User([User]) -->|HTTP| Nginx[Nginx :80]
10
+
Nginx -->|Proxy Pass| API[API Container :8000]
11
+
API -.->|Cache & Chat History| Redis[(Redis :6379)]
1.**Redis Queue (rq) over Celery:** To avoid blocking the FastAPI server during document uploads, we introduced a background worker. We chose `rq` because it is Python-native, simple to configure, and allowed us to maximize our existing Redis container, which was already handling API caching and conversational history.
27
+
2.**Docling for OCR:** Automotive manuals are heavy with complex tables and images. Basic tools like PyPDF fail to preserve this structure. Using Docling required adding graphics libraries (`libGL`) to our Dockerfile, increasing the container size. We accepted this trade-off because it drastically improved vector precision and allowed the LLM to understand tabular technical specs.
28
+
3.**Immutable Deployment CD Pipeline:** In our GitHub Actions CD workflow, we deploy to our DigitalOcean droplet using `git fetch` and `git reset --hard origin/main`. This strict approach ensures the droplet exactly mirrors the repository, treating the server as an immutable target and eliminating manual branch divergence errors.
4
29
5
30
## Features
6
31
@@ -11,7 +36,7 @@ A modern, interview-ready, and production-grade Retrieval-Augmented Generation (
11
36
-**Job Tracking**: Persistent job status tracking (PENDING, PROCESSING, COMPLETED, FAILED) via **PostgreSQL**.
12
37
-**Idempotency & Retries**: Robust job failure handling with exponential backoff and retry mechanisms.
13
38
-**Caching**: Frequently asked questions are cached in Redis to lower latency and LLM costs.
14
-
-**Telemetry & Health Probes**: Includes structured logging, request IDs via middleware, and Kubernetes-style probes (`/health`, `/ready`).
39
+
-**Telemetry & Health Probes**: Includes structured logging, request IDs via middleware, and Kubernetes-style probes (`/health`, `ready`).
15
40
-**Containerized**: Fully orchestrated with **Docker Compose** for easy setup and reproducibility.
0 commit comments