┌─────────────────────────────────────────────────────────────────┐
│ ByeBrief Client │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ React UI │───▶│ Zustand │───▶│ React Flow │ │
│ │ Components │ │ Store │ │ Canvas │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Export Logic │ │ Audit Log │ │
│ │ (MD/DOCX/ │ │ (Session │ │
│ │ PDF/TXT) │ │ Recording) │ │
│ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
│ ▲
▼ │
┌─────────────────────────────────────────────────┼───────────────┐
│ Local Runtime │ │
├─────────────────────────────────────────────────┼───────────────┤
│ │ │
│ ┌─────────────────────────────────────────────▼─────────────┐ │
│ │ Ollama (localhost:11434) │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ │ Generate │ │ Analyze │ │ Draft │ │ │
│ │ │ Draft │ │ Claims │ │ Reports │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────┐ │
│ │ Optional: Web Search API ( Brave ) │ │
│ └─────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
User Action → React Flow → Zustand Store → localStorage (persistence)
User drags node on canvas
React Flow emits onNodesChange event
Zustand store updates node position
Change persisted to localStorage
User clicks AI action → Zustand settings → Ollama API → Parse response → Update UI
User clicks "Generate Draft" or other AI action
Component retrieves current nodes, notes, settings from Zustand
Prompt sent to Ollama at configured base URL
Response parsed and displayed in AI Results Panel
User clicks Export → Gather canvas data → Format (MD/DOCX/PDF/TXT) → Download
User selects export format
Export module gathers nodes, notes, connections
Applies legal-grade template (IRAC structure)
Generates file and triggers browser download
Action performed → Audit log entry → Stored in Zustand → Exportable
Every significant action creates an audit log entry with timestamp.
Ollama Connection (src/ollama.ts)
// Configuration
interface OllamaSettings {
baseUrl : string ; // e.g., "http://localhost:11434"
model : string ; // e.g., "llama3.2"
temperature : number ; // 0.0 - 1.0
topP : number ; // 0.0 - 1.0
maxTokens : number ; // max response length
streaming : boolean ; // stream responses
retries : number ; // retry attempts
}
AI Optimize : Structure analysis, gap detection
Cross-Examine : Claim-evidence mapping, contradiction detection
Generate Draft : IRAC legal method, executive summary
Search Integration (src/search.ts)
Optional Brave Search or Tavily API integration for research assistance.
Data
Storage
Access
Investigation nodes
localStorage
Browser only
Notes
localStorage
Browser only
Session recordings
localStorage
Browser only
Settings
localStorage
Browser only
Audit logs
localStorage
Browser only
What Can Call External Services
Service
Trigger
Data Sent
Ollama
User action
Nodes, notes, prompts
Brave Search
Opt-in, user action
Search queries only
Tavily Search
Opt-in, user action
Search queries only
No telemetry : No usage data collected
No cloud sync : All data local by default
Explicit consent : Search requires API key configuration
Local AI : Ollama runs on localhost only
All settings stored in localStorage
Settings include: model URL, API keys, UI preferences
Clear data option in Settings → UI tab
Module
Responsibility
src/store.ts
Zustand state, audit logging
src/ollama.ts
Ollama API client, prompt templates
src/viral.ts
Viral feature implementations
src/export.ts
File generation (MD/DOCX/PDF/TXT)
src/components/*.tsx
React UI components