Agentia Case study

Agentia

An embeddable AI platform.

Agentia is a multi-tenant AI platform that I designed, architected and built from the ground up. It provides the infrastructure for creating, managing and embedding AI assistants, while keeping the underlying workflows visible and configurable.

Built as a multi-package monorepo, Agentia includes a Next.js application, NestJS API, PostgreSQL database and published npm widget. The assistant in the corner of this website is powered by Agentia itself, demonstrating the platform in a real-world environment.

Role
Product • Architecture • Engineering
Type
Multi-tenant SaaS platform
Built with
Claude Code · spec-driven, multi-agent

Why I built it

The problem

Building production AI assistants still involves a surprising amount of engineering. Before you can validate an idea, you’re wiring together models, prompts, retrieval, memory, authentication and deployment, often rebuilding the same infrastructure from scratch.

I built Agentia to solve that problem. Rather than creating another chatbot, I designed a multi-tenant platform that abstracts the repetitive infrastructure while keeping the underlying architecture visible and configurable.

The result is a platform that can take an idea from concept to a working assistant in minutes, while also serving as an environment for experimenting with agentic workflows, RAG and AI-assisted software development.

Agentia was built to lower the barrier to building AI assistants. By making the underlying concepts easier to understand, people can spend less time fighting infrastructure and more time experimenting with real ideas.
— Matthew Wardle, Creator of Agentia

Overview

A multi-tenant platform, built on visual flows

Every assistant lives in its own workspace with dedicated knowledge, workflows, configuration, branding and analytics. Built on a shared platform architecture, each workspace can be configured, deployed and evolved independently.

At the heart of the platform is a visual workflow engine. Every conversation flows through an execution graph made up of models, retrieval, memory, tools and branching logic. Instead of hiding these concepts behind configuration files, they’re made visible, configurable and easy to experiment with.

The AI assistant on this portfolio is powered by Agentia itself. It runs as an embeddable widget, isolated using Shadow DOM, themed to match the site and bootstrapped from a single assistant ID, demonstrating how the platform can be integrated into any website.

At a glance

The platform in numbers

  • 9

    Apps and packages

    3 apps · 6 packages, one Turborepo

  • 44

    Database tables

    Workspaces, flows, executions, knowledge, billing

  • 2,600+

    Automated tests

    Across 310 test files

  • 7

    Workflow node types

    Entry · LLM · agent · gate · tool · n8n · memory

  • 6

    Built-in tool categories

    Web search, code, email, Slack, webhooks, SQL

  • 10

    Persona archetypes

    Portable across 6 LLM provider types

The product

agentia.chat
Analytics dashboard showing agent performance metrics

Architecture

The runtime, end to end

Every conversation starts in the embedded widget. @agentiachat/react is isolated in Shadow DOM, so it can live on any host site. Messages arrive at a public, visitor-scoped, rate-limited endpoint on the NestJS API.

From there a flow interpreter walks the published flow graph node by node, through entry, LLM, agent, gate, tool and n8n nodes, drawing on personas, retrieved knowledge, memory and MCP tools as it executes.

Execution events and token deltas stream back over SSE, so the answer renders live in the widget while the full conversation is persisted for analytics.

Runtime request flow
Embedded widget

@agentiachat/react, isolated in Shadow DOM on any host site

POST /messages · visitor-scoped · rate-limited
NestJS API

The execution orchestrator loads the published flow

Executes the graph
Flow interpreter

Walks the published flow graph node by node

EntryLLMAgentGateTooln8n

Supporting rails

Personas · Knowledge (RAG → vector DB) · Memory · MCP

SSE · execution events + token deltas
Back in the widget

Tokens render live while the conversation is persisted

Flows are authored in the visual flow builder (the Next.js admin app) and stored in Postgres. The runtime only ever executes the published graph.

How the AI works

Personas, retrieval and the runtime

Every assistant starts with a persona that defines its role, behaviour, goals and response style. Personas remain independent of the underlying language model, making it easy to switch providers without changing how an assistant behaves.

Knowledge is provided through a standard Retrieval-Augmented Generation (RAG) pipeline. Documents are ingested, chunked, embedded and stored in a vector database before being retrieved at runtime to provide grounded context for each response.

Every conversation executes as a visual workflow, allowing models, retrieval, tools, memory and conditional logic to be combined into reusable execution graphs. Each step is streamed to the client, recorded for analytics and can be inspected to understand exactly how an answer was generated.

The RAG pipeline
  1. 01Ingest Documents, websites, PDFs and raw text
  2. 02Chunk Heading-aware chunking with overlap
  3. 03Embed Configurable embedding model
  4. 04Store Vector database
  5. 05Retrieve Top-k semantic search
  6. 06Ground & cite Inject relevant context into the prompt
PersonasMulti-providerRAGVisual workflowsTool callingMemoryStreamingAnalytics

Build with AI

AI-assisted workflow generation

Agentia includes a creation assistant that transforms natural language into a working AI assistant. Describe the behaviour you want and it generates the persona, workflow, knowledge configuration and interface, providing a functional starting point in minutes.

Every workflow is generated as structured data that powers the visual editor. Nothing is hidden behind AI. Every node, connection and configuration can be inspected, modified and extended, allowing AI to accelerate development while keeping the architecture transparent and fully under your control.

Agentia's creation assistant docked beside the flow canvas, planning a persona, flow and chat from a plain-English prompt

How it was built

Built with Claude Code

Agentia was pair-programmed with Claude Code from the first commit to production. I owned the product vision, architecture and technical decisions throughout the project. Claude Code accelerated implementation, but every engineering decision remained mine.

Development followed a disciplined, spec-driven workflow. Features began with a short specification, were implemented collaboratively with AI, validated through testing and refined before being merged. This kept development predictable while maintaining the quality expected of a production system.

As the project evolved, I introduced reusable Claude Code skills and multi-agent workflows to automate repetitive tasks, explore alternative solutions and review larger changes. The result was a faster, more consistent development process without compromising architecture or code quality.

Spec-driven developmentAI pair programmingTest-driven developmentReusable AI skillsMulti-agent workflows

Under the hood

Tech stack

Embeddable widget

@agentiachat/reactShadow-DOM isolation

AI & retrieval

LLM providers (OpenAI, Anthropic · Google · Azure)Agentic flows & personasRAG + citationsEmbedding ModelsVector DBStreaming (SSE)

Built with