← All projects
AGENTIC AI · SENIOR ENGINEER · CONTRACT

Helix: a multi-tenant AI platform that companies run on their own network

I worked on Helix as a senior engineer, as part of the team that builds it. Helix is an AI workspace where a company's staff ask questions of their own documents, raise and track requests, run no-code workflows and manage projects, all with role-based access and an audit log. My part was the system and data design, and several of the core services that sit around the engine.

My role

I was a senior engineer on a team of several developers. I made and wrote down a lot of the architecture decisions, designed the database, and built these pieces myself:

  • the tenancy model (how organisations, their users and their data are kept apart);
  • the LLM gateway on LiteLLM;
  • the workflow system and its engine on Temporal;
  • identity federation: single sign-on, LDAP and Active Directory;
  • security testing, both static and dynamic, and the fixes that came out of penetration tests;
  • the audit log and monitoring: what gets recorded, who can see it, and how model use is tracked;
  • the air-gapped Kubernetes installer.

The problem

Companies wanted an AI assistant that works on their own data, inside their own network, and fits the way they already run things: their directory, their roles, their approval steps. One installation had to serve several organisations without any of them seeing the others' data. Many sites have no internet access, so the whole platform also had to install and upgrade offline.

The architecture

Helix is a set of services behind one gateway. The browser only talks to the gateway, and the gateway routes to each backend:

  • Gateway (Traefik): the single entry point, with security headers, a method allow-list and rate limits on login.
  • Tenant and identity service: the authority for users, groups, roles and permissions. It signs tokens, and the other services check them without a network call and ask it for permission decisions.
  • Core engine (Python, FastAPI): chat with tools and agents, document search, projects, requests, tasks and the workflow API.
  • Workflow engine: our own build of Temporal, with a worker that runs the engine's workflows.
  • LLM gateway (LiteLLM) and a metering service: every model call goes through it.
  • Keycloak: single sign-on and directory federation, behind the identity service.
  • Data: PostgreSQL with one database per service, PgBouncer for connection pooling, Redis, and Milvus for vector search.
  • Helpers: document extraction, a guarded web-fetch service and a private search engine, all internal-only.

What I built

Database and multi-tenancy. I designed the schema and the rules for who owns a row. A row either belongs to the platform, which every organisation can use but never read in full, or to one organisation, which only that organisation can see. Platform credentials are applied on the server and never sent to the caller. For apps an organisation can publish its own version to replace the platform default; for models, prompts and data sources its own entries are added next to the platform's. Every table carries the same standard fields (owner organisation, created and changed by, soft delete), so a record means the same thing in every service.

LLM gateway. All model traffic goes through LiteLLM. Each organisation gets its own key, stored in the vault and claimed on a real person's request. Usage is metered per model and budgets apply. I made one rule on purpose: if metering is on and there is no metered route, chat is refused instead of quietly sent without billing or limits. I also kept the gateway image patched ahead of upstream releases when a dependency had a known vulnerability.

Workflow engine. Requests, approvals and multi-step AI jobs run as durable workflows on our own build of Temporal. We ported an existing graph engine onto it, so a workflow drawn in the no-code editor runs as one Temporal workflow, with retries and a full history of every run. This replaced a separate workflow service and its task queue, so there are fewer moving parts to deploy.

Identity. Users sign in once through Keycloak. Customers keep their LDAP or Active Directory as the source of truth, and Helix federates with it instead of copying users across. Group sync has filters so only the groups that matter come across, and an organisation can map directory groups to its own groups automatically when a user first signs in.

Audit log and monitoring. Changes to items, tasks and workflow runs go into an activity log that says who did what, to which record, and when. Admins can filter it by person and by record. Writing a log entry can never make the change itself fail. When an admin changes a directory sync policy, the previous version is kept as a diff, so you can see exactly what changed. Each organisation sees only its own entries, and how long entries are kept is a setting. For monitoring, every model call is recorded, whether it comes from chat, a workflow step, document search or image captions, with tokens in and out and the cost per model. Owners see usage and traces for their whole organisation; members see only their own. On the cluster, the installer gives the services liveness and readiness checks, so Kubernetes restarts a stuck service and holds traffic until a new one is ready.

Security

  • Static checks in the pipeline: Gitleaks for secrets, Bandit and Semgrep for code, pip-audit for dependencies, and Trivy on every image. A fixable critical finding blocks a production push.
  • Dynamic checks: an OWASP ZAP baseline scan runs after deployment.
  • Penetration testing: I ran tests against self-hosted test deployments, and an external penetration test was also done. I worked through its findings on the engine, the gateway and the installer:
    • private-by-default projects;
    • authenticating the chat socket before reading anything else;
    • 404s that don't reveal whether a record exists;
    • generic error bodies from the model gateway;
    • optional network policies.

Deployment: the air-gapped installer

Many customer sites have no internet. I built the installer (v2) that packages Helix into one offline bundle. Every site gets the same tarball and picks its platform in a single config file. It runs on any conformant Kubernetes 1.28+ (RKE2 tested) and OpenShift 4.x. Both platforms sit behind one small adapter contract, so the operator always runs the same five commands: preflight, images, install, upgrade and rollback. A separate tool turns a plain Linux VM into an RKE2 node ready for the platform.

  • One Helm chart that checks its own settings: it refuses an invalid configuration at install time, naming the setting to fix, instead of failing later inside the cluster.
  • Supply chain: every image is scanned with Trivy and Grype, gets SBOMs in SPDX and CycloneDX, and carries written OpenVEX rulings for findings that don't apply.
  • Tested offline: the whole installer is written in Bash, kept in testable modules, and checked with bats and ShellCheck. The test suite needs no network, no cluster and no credentials.

Outcome

Helix is in production at customer sites. It runs as one platform for several organisations, with their data kept apart, sign-in through their own directory, and model use that is metered and capped. It installs on a customer's own Kubernetes or OpenShift cluster with no internet access. The engine's test suite had 9,597 passing tests at the time of the penetration-test fixes.

Contract work. The code is private, and details that identify customers or internal systems are left out.

Python · FastAPI · PostgreSQL · Temporal · LiteLLM · Keycloak · LDAP / AD · Redis · Milvus · Kubernetes · OpenShift · Helm
Helix in 75 seconds
Chat answering a cold-chain question step by step from the company's own SOP, with the source linked
Chat turning operations data into a short weekly update, with token use and speed shown per answer
No-code workflows that run each request type, such as safety incidents and purchase requests