55 lines
2.0 KiB
Markdown
55 lines
2.0 KiB
Markdown
# Architecture
|
|
|
|
```mermaid
|
|
flowchart LR
|
|
Client[React Dashboard] -->|WebSocket transcript chunks| Gateway[Streaming Gateway]
|
|
Gateway --> Orchestrator[AI Orchestrator]
|
|
Orchestrator --> Context[Context Builder]
|
|
Orchestrator --> Memory[Memory Manager]
|
|
Orchestrator --> Planner[Hybrid LLM Planner]
|
|
Orchestrator --> Registry[Generated Tool Registry]
|
|
Orchestrator --> Policy[Policy Engine]
|
|
Orchestrator --> Validation[Validation Layer]
|
|
Orchestrator --> Publisher[Event Publisher]
|
|
Client -->|approve/reject/edit| Review[Pending Review API]
|
|
Review --> Generator[API Call Generator]
|
|
Generator -->|method + URL + headers + JSON + cURL| GeneratedCall[Generated Wed API Call]
|
|
GeneratedCall -. not sent .-> WedAPI[Wed Backend API]
|
|
Executor -. dashboard demo state .-> REST[REST Demo Backend]
|
|
REST --> Postgres[(PostgreSQL)]
|
|
WedAPI --> WedPostgres[(Wed PostgreSQL)]
|
|
Context --> Redis[(Redis)]
|
|
Publisher --> Streams[(Redis Streams)]
|
|
Memory --> Qdrant[(Qdrant)]
|
|
```
|
|
|
|
## Sequence
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant UI as React Dashboard
|
|
participant WS as Streaming Gateway
|
|
participant O as Orchestrator
|
|
participant P as Planner
|
|
participant V as Validation
|
|
participant PE as Policy Engine
|
|
participant DB as PostgreSQL
|
|
participant EX as Executor
|
|
|
|
UI->>WS: transcript chunk
|
|
WS->>O: ConversationEvent
|
|
O->>P: transcript + context + memories + tools
|
|
P-->>O: structured plan
|
|
O->>V: validate schema and parameters
|
|
O->>PE: evaluate confidence, duplicates, rules
|
|
O->>DB: create PendingAction
|
|
UI->>DB: approve/edit/reject pending action
|
|
UI->>EX: approve / generate call
|
|
EX-->>DB: store generated API call
|
|
EX-->>UI: generated call state
|
|
```
|
|
|
|
## Design Notes
|
|
|
|
The planner never executes tools. It produces structured decisions against the Wed backend tool contract, the policy and validation layers gate those decisions, and approval only generates the exact Wed REST call. The app does not send that call to the Wed backend. The deterministic planner keeps demos and tests reliable when no Claude key is configured.
|