flowchart TD A[Committed user speech + provider context] --> B[Realtime model + grounding / Persian delivery policy] B --> C{Need document evidence?} C -->|Greeting / focused clarification| Z[Short answer without retrieval] C -->|New topic| D[search_knowledge] C -->|Same-topic continuation| E[reuse_last_evidence] E -->|Retained search / current eligibility| J E -->|Fresh search required| D D --> F[Validate tool args / backend identity / deadline / durable dedup] F --> G[Normalize query + local bge-m3 embedding] G --> H[PostgreSQL: semantic + exact-pattern branches] H --> I[Merge / deduplicate / measured cutoff / bounded evidence] I --> J[Recheck authority / revisions / document eligibility] J --> K{Backend result} K -->|ok| L[Private evidence to model: document_id + chunk_id + labels] K -->|no_evidence| N[Say evidence is insufficient; invent no facts] K -->|error| X[Say technical check failed; invent no fallback] L --> M[report_used_sources: only supporting current-turn labels] M --> V[Backend validates reported labels and delivery eligibility] V -->|Invalid report| M V -->|Valid subset| O[Sources event to browser] V --> P[Model generates grounded spoken answer] P --> Q[VoiceRuntime: audio / transcript / playback / interruption gates] Q --> U[Browser playback + rendered used sources]