Challenge Framing
MindMirror predictions and scores were useful but difficult to interpret conversationally, while unconstrained assistants would introduce hallucination and out-of-scope risk in a sensitive domain.
Rather than building a general chatbot, this service was intentionally constrained around psychology interpretation. That tradeoff improves relevance, trust, and production safety.

Case Study
Project Overview
Built a memory-aware AI service that turns structured MindMirror predictions into grounded conversational explanations using user-specific retrieval, cache reuse, and corrective web search with explicit domain restrictions.
Challenge Framing
MindMirror predictions and scores were useful but difficult to interpret conversationally, while unconstrained assistants would introduce hallucination and out-of-scope risk in a sensitive domain.
Solution Strategy
I designed a LangGraph-based orchestration flow with domain routing, user-scoped retrieval, hybrid memory, semantic cache reuse, and corrective search rules that stay inside psychology.
Project Highlights
Gallery
Selected screens show the visible product experience and the operational surfaces behind each project. Projects without captured assets keep a structured placeholder until real screenshots are available.
MindMirror Conversational AI Agent
Every request enters a controlled route decision before retrieval or synthesis is allowed to run.
MindMirror Conversational AI Agent
Memory, user predictions, and optional corrective search are composed into a bounded context package.
MindMirror Conversational AI Agent
Node-level SSE events make graph progress and request timing observable in real time.
Tech Stack
Agent orchestration, guarded retrieval, personalized memory, domain safety, and operational observability for AI-backed products.
Key Features
The router enforces domain restriction before retrieval or generation begins.
Prediction data is resolved against canonical user identity before context assembly.
Short-term conversation state and long-term facts are recalled under a strict token budget.
SSE streaming and observability hooks expose graph progress, latency, and debugging context.
Architecture
Each layer stays explicit so reviewers can quickly understand where interface, orchestration, persistence, and service responsibilities live.
Chat, streaming, health, graph, and memory endpoints expose the service to MindMirror clients and developers.
LangGraph coordinates recall, routing, cache, retrieval, synthesis, and memory write-back.
Supabase stores operational memory and user data while Chroma supports semantic cache lookup.
System Flow
The pipeline section keeps the most important engineering steps visible without collapsing them into generic bullet lists.
Load recent turns and long-term facts under a bounded context budget.
Classify the query into a safe execution path and reject non-psychology requests.
Resolve user identity, fetch prediction context, or expand into corrective search when internal evidence is weak.
Generate grounded explanations, then persist cache hits and memory-worthy facts for future turns.
Timeline
This timeline keeps the implementation story concise: what was framed first, what was hardened next, and what ultimately made the project production-ready.
Constrained the assistant to psychology and MindMirror contexts before retrieval logic was added.
Introduced short-term recall, long-term fact distillation, and semantic cache reuse for repeated queries.
Added streaming graph visibility and observability hooks to support debugging and cost inspection.
Challenges
Each challenge is tied to a concrete design choice and a specific outcome.
Solution
Added layered routing constraints, a fixed safe route set, and reject paths before retrieval and synthesis.
Outcome
Improved trust and reduced generic-chatbot drift.
Solution
Separated short-term memory from distilled long-term facts and enforced a strict recall budget.
Outcome
Maintained personalization without degrading answer quality.
Solution
Combined exact cache keys with semantic similarity matching scoped by user, route, and context hash.
Outcome
Improved repeat-query efficiency while staying personalized.
Results
The emphasis here is signal, not decoration: key numbers, verifiable outcomes, and the context needed to interpret them responsibly.
7nodes
Execution Graph
Recall through memory write-back in a reusable LangGraph flow.
5
Route Types
Direct, RAG, memory, web search, and reject.
500tokens
Recall Budget
Memory context stays constrained and intentional.
30 / 90d
Memory Policy
Short-term turns plus 90-day long-term fact retention.
Key Results
Business Impact
Turns raw behavioral inference tables into an explainable conversational experience that feels more useful to end users.
Shows a mature AI system design mindset: scoped behavior, explicit routing, memory policy, observability, and fallback control.
Continue