-
Notifications
You must be signed in to change notification settings - Fork 7
OpenAIPro and Agent Stack
Nathan Smith edited this page Nov 15, 2025
·
1 revision
Quickfire ships with two complementary AI layers:
- OpenAIAgent + Semantic Kernel – the conversational / navigation / SQL / task brain that powers Enhanced AI Chat and SmartPaste buttons on feature pages.
- OpenAIPro – a lower-level HTTP client optimized for long-running, strict-schema automations (Proposler, SmartPaste intake, attachment enrichment).
-
Files:
src/Quickfire.Blazor/Domain/Agents/Services/OpenAIAgent.cs,NavigationAgent.cs,ParameterExtractionService.cs,TaskAgents/* -
Models:
Domain/Agents/Models/UnifiedRequest,UnifiedResponse,IntentClassificationResult -
Key dependencies:
Microsoft.SemanticKernel,QdrantVectorStore,OpenAIEmbeddingService,NavigationAgent -
Capabilities:
- Intent classification (GeneralAI, DatabaseQuery, Navigation, TaskAgent, SmartAction)
- SQL generation with schema loading (
wwwroot/schema/extractor.json) and validation (blocks DDL/DML) - Vector-powered navigation by resolving client/policy names via embeddings
- Streaming status updates (UI shows progress spinner; streaming output wiring ready via
ProcessRequestStreamingAsync) - Task agent orchestration (
ITaskAgentimplementations live inDomain/Agents/TaskAgents)
-
EnhancedAIChat.ChatHandlers.SendMessagebuilds aUnifiedRequest(input, sessionId, context) -
OpenAIAgent.ProcessRequest{Streaming}validates input, appends to chat history, classifies intent (unlessmanualIntentsupplied) - Intent-specific handler executes (database query via EF, navigation via
NavigationAgent, TaskAgent execution, general AI completion) - Response serialized back to the page, which renders Markdown/HTML and triggers navigation or toast events
- Models use
gpt-4.1by default (centralized inOpenAIAgentctor). Change there if needed. - API keys resolved from
builder.Configuration["OpenAI:ApiKey"]populated inProgram.csfromOPENAIenv var - Embeddings use
text-embedding-3-smallviaOpenAIEmbeddingService; vectors stored/fetched viaQdrantVectorStore -
NavigationAgentalso builds its own Semantic Kernel instance – keep model IDs in sync withOpenAIAgent
-
File:
src/Quickfire.Blazor/Domain/Shared/Services/OpenAIPro.cs - Use cases: SmartPaste, Proposler JSON cleanup, attachment tagging, PDF/Word data extraction
-
Features:
- Uses named HttpClient
"OpenAI"with custom timeout and SSE support - Reads prompt templates (
wwwroot/prompts/*.txt) and schema definitions (wwwroot/schema/*.json) - Streams progress through
StateService.UpdateStatusso the UI can show user-friendly updates - Persists intermediary and final outputs as
Attachmentrecords viaAttachmentService - Supports long-running tasks (up to ~230s timeout) and handles retry/backoff manually when needed
- Uses named HttpClient
- Collect attachments (JSON, TXT, PDF) and pass them to
OpenAIPro - Build the full prompt from template + schema + file contents
- Call OpenAI completions endpoint (model default
gpt-4.1but overrideable per method) - Parse/validate JSON before saving as attachments or merging into domain models
- Update status + log events through
ILoggingService
-
Docs:
src/Quickfire.Blazor/Domain/Agents/README.md -
Interfaces:
ITaskAgent,ITaskAgentRegistry,IParameterExtractionService -
Usage:
- Agents expose metadata (triggers, required parameters, outcome type) and implement
ExecuteAsync - Parameter extraction uses AI prompts defined per parameter with optional entity extraction (client, carrier, policy type)
- Agents can be invoked from Enhanced AI Chat or via action buttons on renewal/client pages
- Agents expose metadata (triggers, required parameters, outcome type) and implement
-
Domain/Agents/Pages/EnhancedAIChat.Voice.cswires microphone capture throughwwwroot/js/enhanced-ai-chat.js -
TranscriptionServicesends audio to OpenAI Whisper endpoints; responses feed right back into the chat pipeline - Tray + Word helpers (
Quickfire.Tray/Methods/WordControl.cs) capture structured data for AI prompts (e.g., Word doc contents for Business Details editors)
- Increase logging via
appsettings.Development.json(e.g., setSurefire.Domain.Agents.Services.OpenAIAgenttoDebug) - Database query debugging is covered in agents/Database-Debug-Guide
- To test agent health, use the
/agents/enhanced/chatpage and watch the status ring in the layout; errors bubble through_statusbar
| Scenario | Use this |
|---|---|
| Conversational chat, SQL answers, nav, parameter extraction | OpenAIAgent |
| Strict JSON transformation, long-running multi-file prompts, attachment persistence | OpenAIPro |
| Simple "complete this text" or legacy prompt |
OpenAISimpleService (wrapper around HttpClient, useful for lightweight calls) |
Whenever you add new automations, document the prompt templates under /wwwroot/prompts, cite them here, and keep sample payloads in /ref for quick regression checks.
Quickfire Wiki • Generated from Qf-Docs/wiki • Last updated: 2025-11-14.
See the main repo for README + issues.
- Home
- Getting Started
- System Architecture
- Release Notes
- Features
- Agents & AI
- Reference
- Guides
- Integrations
- Archive