AI Decision Engine

AI Decision Engine

A production-grade MLOps backend that handles live AI inference routing, A/B testing, automatic drift detection, instant rollbacks, and feedback-driven training loops built with FastAPI, PostgreSQL, MongoDB, and Redis.

Released on 5/7/2026

AI Decision Engine

A smarter way to run AI in the real world


What is this project?

Imagine you have trained an AI model and you want to use it in a real application but you are not sure how to manage it safely, keep it working well over time, or test improvements without breaking things for your users.

The AI Decision Engine solves exactly that.

It is a complete backend platform that sits between your AI model and your users. It receives requests, asks the AI for a prediction, and sends the answer back all while quietly handling a lot of complex work behind the scenes that most AI projects ignore entirely.

Think of it like the control room for your AI: it manages traffic, watches for problems, runs experiments, and keeps everything running smoothly , even as your models evolve.


Why does this exist?

Most tutorials show you how to train a model. Very few show you what happens after , how do you actually run it for real users? How do you update it without downtime? How do you know when it starts giving bad answers?

This project was built to answer those questions. It mirrors what large tech companies do internally to manage AI at scale, and makes that architecture accessible in one open, well-structured codebase.


What can it actually do?

Serve AI predictions — fast

When a user submits data, the engine instantly routes it to the right AI model, gets a prediction, and returns the result. The whole process is designed to be as fast as possible , it even saves the log of what happened after the response is already sent, so nothing slows down the user experience.


Test new models safely — without risking your users

Let's say you have trained a smarter version of your model and want to try it in production. But what if it has bugs? What if it is actually worse?

The engine lets you run A/B tests for example, send 90% of users to your trusted model and 10% to the new one. You can watch how the new model performs in the real world before fully committing to it.


Roll back instantly if something goes wrong

If a new model starts misbehaving, you do not need to redeploy anything or dig through code at 2am. One API call is all it takes to switch 100% of traffic back to the last stable model. Disaster averted in seconds.


Automatically detect when your AI starts going stale

AI models can quietly degrade over time , the real world changes, but the model does not. This is called drift, and it is one of the sneakiest problems in production AI.

The engine runs background checks on recent predictions, looking for signs that the model's behaviour is shifting. When it notices something unusual, it raises an alert so your team can act before users are affected.


Collect feedback and build better training data

Every prediction the engine makes can be linked back to what actually happened in the real world. Users or systems can submit that ground truth back to the platform, and the engine automatically organises it into a clean dataset — ready to train your next, improved model.

This creates a continuous improvement loop: the more the system runs, the better your future models can become.


Control who can do what

Not everyone on your team should have access to everything. The engine comes with a built-in permission system with four roles:

  • Admin — full control over the platform
  • Engineer — can manage models and run experiments
  • Analyst — can read data and review results
  • Client — can submit requests and send feedback

Every user logs in with a secure token, and every action is verified against their role before it is allowed.


See what is happening at a glance

The engine connects to professional monitoring dashboards (Grafana) that show you live charts of how fast the system is responding, how many requests are coming in, and whether drift scores are climbing. No guesswork — just clear visibility.


How is the data stored?

The engine uses three different databases, each chosen for what it does best:

  • PostgreSQL — stores structured, important records like user accounts and model information. Think of it as the filing cabinet.
  • MongoDB — stores the large, flexible logs of every prediction and feedback entry. Think of it as the activity journal.
  • Redis — handles fast, temporary tasks like caching recent results and enforcing request limits. Think of it as short-term memory.

Each database does the job it was built for, which keeps the whole system fast and reliable.


Who is this for?

This project is for developers and engineers who want to understand — or demonstrate — how production AI systems are actually managed. It is useful if you are:

  • Building a portfolio and want to show real-world backend thinking
  • Learning how MLOps (machine learning operations) works in practice
  • Starting a project that will eventually need serious AI infrastructure
  • Exploring how companies like Google, Meta, or Uber manage their models internally

Tech used to build it

| Layer | Technology | |---|---| | API framework | FastAPI (Python) | | Relational database | PostgreSQL | | Document database | MongoDB | | Cache & rate limiting | Redis | | AI / machine learning | scikit-learn | | Packaging & deployment | Docker, Docker Compose | | Monitoring | Prometheus, Grafana |


License

This project is free to use for learning, personal projects, and portfolio purposes. Commercial use requires written permission from the author.