Back to selected work
Case Study

Medaura - Agentic Pharmacy System

Medication errors are an information problem: the data exists, but it is not connected at the moment it matters.

Langfuse TraceRouting latency under 120ms
Medaura - Agentic Pharmacy System — technical overview
RoleLead engineer
StatusLive system
StackFastAPI / LangChain / LangGraph / ChromaDB / Langfuse / Groq / React

Problem

Pharmacy workflows fail when prescription, inventory, safety, and procurement data are separated. The goal was to make a system that can reason across those boundaries while keeping every agent decision auditable.

Architecture

User InterfaceReact, multilingual UI
Router AgentIntent classification and dispatch
Ordering AgentPrescription and order flow
Safety AgentDrug interaction checks
Forecast AgentDemand prediction
Procurement AgentSupplier matching
ChromaDB + LangfuseRAG, traces, observability

Key Decisions

Agent boundaries map to pharmacy responsibilities

Each agent owns a domain responsibility instead of a generic helper function. That made routing easier to reason about and made failure traces more useful.

Safety checks use retrieval, not only prompts

The Safety Agent queries a drug-interaction knowledge base before order confirmation so important contraindications are represented as retrievable evidence.

Observability is treated as product infrastructure

Every agent call is traced with Langfuse because multi-agent failures are impossible to debug from the final answer alone.

Lessons / Results

  • Agent decomposition is an architecture problem before it is a prompting problem.
  • Without traces, multi-agent systems become impossible to trust in production.
  • The most important UX is often the operational visibility behind the interface.

Theoretical Foundation

© 2026 Pranav Dhiran

Contact