Back to projects
AI AgentsMicroservicesRAGEvent-driven Architecture

ClariQ

A customer-support automation system built around explicit service boundaries, retrieval, and event-driven processing.

Role
System design and backend engineering
Focus
AI Agents / Microservices
Stack
Python, FastAPI, Redis

Context

The shape of the problem

The work started with a familiar operational problem: support teams had recurring email questions, fragmented knowledge, and little leverage from previous answers. The goal was not just to call an LLM, but to design a system that could ingest emails, search a controlled knowledge base, draft useful responses, and remain observable enough to operate.

Build

What I actually built

I split the platform into clear services for mail ingestion, orchestration, agent work, and search. Redis carried events between services, PostgreSQL held durable state, and Qdrant powered semantic retrieval. The interesting part was making the agent workflow boring in the right way: explicit states, logs, health checks, and retrieval steps that could be inspected when an answer was wrong.

Engineering

Key decisions

01

Designing and implementing a scalable microservices architecture for robust email processing

Developed core microservices (Mail Connection, Orchestrator, Agent, Search) with explicit event-driven workflows and PostgreSQL state tracking

02

Creating a custom-built RAG system using low-level tensor operations for accurate retrieval

Built a custom RAG solution leveraging tinygrad and Qdrant for efficient semantic search and accurate text embeddings

03

Ensuring reliable event-driven communication and explicit state management across services

Applied computational graph patterns and sophisticated NLP techniques for query reformulation and answer synthesis

04

Implementing comprehensive logging and monitoring for observability and operational reliability

Implemented structured JSON logging, comprehensive health checks, and transactional processing to ensure operational excellence

Outcome

What changed

  1. 01Delivered a production-ready platform with clear microservice boundaries and reliable performance
  2. 02Successfully integrated custom NLP and vector search techniques to maintain high-quality automated responses
  3. 03Provided robust, flexible infrastructure that enables easy feature extension and continuous improvement

Stack

Tools and systems

PythonFastAPIRedisPostgreSQLQdranttinygradDockerGrafanaLokiPromtail

I build delightful systems.

© 2026 Kristian Ernst.