← All work

Containerised RAG application with CI/CD

MedBot

A document question-answering service: retrieval over a vector index, a Flask backend, a container image, and a Jenkins pipeline that scans the image before it ships.

LangChainFAISSLLM APIsFlaskDockerJenkinsTrivy
TypeRetrieval-augmented generation
SurfaceFlask API + HTML/CSS frontend
DeliveryDocker image, Jenkins pipeline
SecurityTrivy container scanning

Why a confident answer needs a source

A general-purpose language model answers a question about a document with equal confidence whether or not that document is in its context. For document-based question answering that is the wrong behaviour. The useful output is an answer built from the material the user actually supplied.

The second problem is delivery. A retrieval pipeline that only runs in a notebook is a demonstration, not a service. The application needed a request path, a deployable artefact, and a repeatable way to get from a commit to a running container.

What I built

MedBot is a retrieval service rather than a prompt: documents are chunked and embedded into a FAISS index through LangChain, a query is embedded and matched against the index, and the retrieved passages are passed to the language model as grounding context for the answer. The design decision is the boundary between retrieval and generation: what the index returns is what the model is given to answer from.

  • Retrieval layer: LangChain orchestration over a FAISS vector index.
  • Serving layer: a Flask backend with an HTML/CSS frontend.
  • Packaging: the full application ships as a Docker image built in the Jenkins pipeline.
  • Delivery: a Jenkins pipeline automates testing, container builds and the deployment workflow.
  • Security: Trivy scans the container image for known vulnerabilities inside the pipeline.

From commit to running container

The engineering question is what happens next: can the same build be reproduced, does a vulnerable base image block a release, and can the service be redeployed without a manual checklist?

On every build, the Jenkins pipeline runs the tests and builds the Docker image. Trivy then scans that image for known vulnerabilities in its packages.

What it demonstrates

  • End-to-end retrieval-augmented generation: ingest, index, retrieve, answer.
  • A service boundary: an HTTP surface, a container image and a repeatable deploy.
  • Release checks inside the pipeline itself, including a Trivy scan of the image.

Limits and next steps

This is a personal project, so there is no production traffic to report and no user study to cite. Chunking strategy drives answer quality, the index has no refresh policy, and no evaluation harness scores answers against a labelled set.

The next build would add a small evaluation set with retrieval and answer-level checks, so a change to chunk size or model can be judged rather than guessed. MedBot has no public repository, so this page is the record of the work rather than a link to it.