Case Study · Education & Publishing

Building a Safer, Faster AI Learning Assistant

A global education platform wanted to put generative AI in front of millions of students. I helped design the agentic architecture that made it safe, fast, and affordable at the same time.

Industry: Education & publishing  ·  Focus: Agentic AI, RAG & safety  ·  Client: Confidential global organization

The Challenge

Four Forces Pulling Against Each Other

Students probe limits. Safety checks add delay. Powerful models cost money. And every answer must stay true to the textbook. Tightening one usually breaks another, so the architecture had to solve all four at once.

The Solution

Every Question Takes the Right Path

Instead of one chatbot handling everything the same way, a controlled agentic workflow screens each request, reads its intent, and routes it to a right-sized path. Orchestrated with LangGraph, so every decision is deterministic and inspectable.

The router is why costs dropped: 62% of questions never touch an expensive model. The screening and validation layers are why safety held without slowing anything down.

It was not all smooth.

Early on, the router sent a meaningful share of math questions down the light path, and the small model struggled with multi-step problems. The fix: a confidence threshold. When the router is not sure, the question moves up a tier. Routing systems need a way to say "I don't know."

Safety Design

Defense in Depth, Not a Single Filter

No single check catches everything, so several independent layers surround the model. A request must pass all of them, and each layer can fail without the whole system failing.

Under the hood: prompt-injection detection, topic guardrails, harmful-content checks, and Pydantic schema validation, tested against adversarial benchmarks including the OWASP Top 10 for LLM applications.

Performance

Safety Checks in Parallel, Not in Line

More safety layers usually means more waiting. Running independent checks at the same time removed that penalty almost entirely.

Under the hood: Python AsyncIO and thread-based concurrency across independent safety and validation services.

Content Pipeline

From Textbook PDF to AI Knowledge in Minutes

The assistant is only as good as the content it can reach. An event-driven pipeline turns complex textbooks, with all their tables and formulas, into searchable knowledge automatically.

Hours of manual preparation per book became minutes of automated processing.

Under the hood: Kafka event streaming, Azure Document Intelligence, OpenAI embeddings, vector databases.

Measured Impact

What Controlled Testing Showed

85%
Fewer successful adversarial attempts
Before 12.4% After 1.9%
70%
Faster safety processing
Before 1.5s After 0.45s
27%
Lower average model cost
Before $0.042 After $0.030

Figures reflect controlled testing and internal evaluation rather than a guarantee of future production results. Every request also became fully traceable, from routing decision to final answer, with LangSmith.

Key Lessons

What This Engagement Reinforced

1

Safety is architectural

It shapes routing, retrieval, and model choice. It is not a filter bolted on at the end.

2

Agentic does not mean uncontrolled

The most valuable enterprise agents make narrow, observable decisions inside explicit boundaries.

3

Bigger is not always better

Reserving powerful models for questions that need them cuts cost without cutting quality.

4

If you can't trace it, you can't defend it

Observability turns "why did the AI say this?" into a question with an answer.

Beyond Education

The Same Blueprint Works Wherever Trust Is Non-Negotiable

Insurance claims, patient education, financial guidance, legal knowledge bases: they all need grounded answers, layered safety, right-sized models, and a complete audit trail. This is that blueprint.

Full stack: Python · LangChain · LangGraph · LangSmith · Azure Document Intelligence · Azure Prompt Shield · AWS Bedrock Guardrails · NeMo Guardrails · Kafka · OpenAI APIs · vector databases · Pydantic · AsyncIO

Confidentiality note. This case study describes work completed for a global education and publishing organization. The company name and selected implementation details have been intentionally omitted to protect confidentiality.

Ready to Build AI Your Organization Can Stand Behind?

EDRON AI designs systems that are safe by architecture, not by accident, and trains your team to own them.

Book a Free AI Strategy Call