Self-built product

Bastion

A private RAG system that runs entirely on a server you own, answering from your documents with the exact passage, page and section.

A complete product I designed, built and tested myself. Client work is in Case studies.

Bastion answering a question about the London hotel limit from the expenses policy, with the cited page shown in a sources panel

Some documents can’t leave your server

Many teams want to ask questions of their own documents but can’t send them to a public AI service. Bastion keeps the whole system, model included, on a server you own.

Answers from your documents, and says so when it can’t

Bastion answers from PDFs, Word files and web pages with the exact passage, page and section, and says so when the answer isn’t there. Text inside a document that tries to give the AI orders is flagged and treated as plain text.

People log in with admin, editor or member roles; rate limits and an audit log keep use in check.

Local model, one install script, backups that restore

The model runs locally with Ollama, so no data leaves the server and there are no per-message API fees. One install script sets up Docker, the firewall, nginx and SSL on an Ubuntu VPS or AWS EC2. Nightly backups restore with one command, and updates take a backup first and show rollback steps if a health check fails.

Tech stack

  • Python
  • FastAPI
  • Qdrant
  • Ollama
  • Docker
  • nginx

Tested to run unattended

Bastion has 83 automated tests.

Screens from Bastion

Bastion answering that it cannot find a general-knowledge question in its documents, and listing the closest passages it rejected as not close enough

When the answer isn’t in the documents, it says so.

Bastion in dark mode answering how suppliers change bank details, with a warning that one retrieved passage contains instructions aimed at an AI, which it treats as plain text

Text that tries to give the AI orders, flagged and treated as plain text.

Bastion activity log listing each question, the documents it cited, response times and sign-ins, with CSV export

The audit log.

Bastion system page: API, model server, vector database and database status, the search index, nightly backups, and per-person question and upload limits

System health and backups.

Bastion answering a taxi expenses question with its source, then telling the user they have reached the question limit for now

A rate limit in action.

Want something like this for your business?

Tell me what you need it to do. I’ll reply within 24 hours on weekdays with questions or a suggested first step.

Start with the $150 scoping session, credited toward the build.