AI & Backend·November 29, 2026·5 min read

NYAYA — Legal AI Voice Counsel

Reactive 3D voice orb + chat mode with PDF/DOCX contract clause analysis.

NYAYA — Legal AI Voice Counsel
UI Mode
Voice Orb + Chat
Inputs
PDF · DOCX · TXT
Analysis
Clause Risk Scan
Stack
TypeScript · Next.js

Pipeline & core implementation

Architecture Pipeline
Voice / DocExtractorRisk ScanSpoken + Chat
What broke first: Switching from voice mode to text chat initially reset uploaded contract context; lifting parsed document state into a shared session store preserved full continuity.
clause_risk.ts · TypeScript
export function flagRiskyClauses(text: string) {
  return RISK_PATTERNS.filter((rule) => rule.regex.test(text));
}

Seamless voice-to-chat workflow

Most legal AI tools trap users inside dense form UIs. NYAYA opens directly into a reactive canvas Voice Orb that mirrors live microphone amplitude across Listening, Analyzing, and Speaking states, while a single click swaps into a full formatted chat workspace with zero state loss.

In-conversation contract analysis

Instead of separating document upload from conversation, PDFs, DOCX files, and plain text contracts parse inline during a voice session. A deterministic clause scanner flags asymmetric termination, indemnification, and jurisdiction clauses alongside plain-English explanations.

Outcome & architecture takeaway

All core flows — voice state machine, seamless chat toggle, client/server contract parsing, and clause risk annotation — are implemented and verified end-to-end in TypeScript and Next.js.

Measured benchmarks

PDF/DOCX extraction~180 msClient + APIPreserved across modes
Mode transition0 ms state lossShared contextVoice ↔ Chat

Project status & checklist

● Completed
Done
  • Interactive Voice Orb UI (Listening / Analyzing / Speaking states)
  • Zero-state-loss toggle between Voice Mode and structured markdown Chat Mode
  • PDF, DOCX & TXT ingestion pipeline with inline contract risk detection
Needs to be done

All planned milestones complete.