This repository ships a runnable example of a customer-support LLM agent that proves three things:
- Natural language prompts can be turned into schema-governed Kafka events without manual glue code.
 - Every response is validated against a JSON Schema and dead-lettered if it drifts, giving you deterministic observability.
 - Evaluation services consume from Kafka, validate against the Schema Registry, and publish scored results so model performance is traceable.
 
- Clone the repo and create a virtual environment:
python -m venv .venv source .venv/bin/activate pip install -e .[dev] - Copy the environment template and update the values:
cp .env.example .env
- Always set 
OPENAI_API_KEYwhenUSE_OPENAI_CLIENT=true. LeaveUSE_OPENAI_CLIENT=falseto use the deterministic built-in model. 
 - Always set 
 - Bring up Kafka, Schema Registry, and the UI:
docker compose up -d
 - Register schemas and publish sample prompts:
make bootstrap-schemas make demo-prompts make publish-demo-prompts # pushes three valid prompts and one DLQ trigger - Start the agent:
Watch the responses appear on the
make run-agent
customer-query-responsestopic (three valid records), and one failing payload land incustomer-query-dlq. 
- Agent loop – 
src/agent/service.pyconsumes prompts, calls the LLM client, validates againstschemas/customer-query-response.jsonschema, and publishes to Kafka. - Structured outputs – 
src/agent/models.pydefines the Pydantic schemas that keep the LLM honest; the synthetic client insrc/agent/llm.pywill emit an invalid record whenever the prompt includes[invalid-schema-demo]. - Evaluation hooks – evaluators under 
src/evaluators/illustrate how to score responses and push results tocustomer-query-evaluations. - Docs & samples – The 
docs/folder explains the architecture, whilemake demo-promptssaves ready-to-use JSON prompts underdemo/prompts/. 
- Run formatting and static checks: 
make format - Execute the full test suite with coverage: 
make test - Rehydrate the demo prompt set: 
make demo-prompts - Produce prompts onto Kafka (includes the DLQ trigger): 
make publish-demo-prompts 
The combination of Kafka, Schema Registry, and structured LLM responses is meant to show that generative systems can be governed and versioned the same way as any other enterprise data pipeline.