============================================================
π Implementation plan for this work: Hermes AI β Implementation Plan
(grounded on the completed SIAAS infrastructure preparation).
In a dental practice what are the most typical types of work/treatment that take place?
The most typical types of dental treatments are categorized into ==preventive, restorative, emergency, and cosmetic care==. [1, 2]
These routine treatments focus on monitoring oral health and preventing active disease. [1, 2]
Restorative dentistry repairs teeth damaged by decay, fractures, or wear. [8, 9]
These procedures address active infections, severe pain, or structural issues. [2]
These elective treatments improve the alignment, function, and aesthetics of a patient's smile. [1, 2]
| Category | Frequency | Primary Purpose | Key Examples |
|---|---|---|---|
| Preventive | High (Every 6β12 months) | Maintain health, spot issues early | Check-ups, cleanings, X-rays |
| Restorative | Moderate to High | Fix decay or physical damage | Fillings, root canals, crowns |
| Surgical | Low to Moderate | Relieve pain, remove infection | Extractions, wisdom tooth removal |
| Cosmetic | Elective | Improve appearance, alignment | Whitening, aligners, veneers |
If you are researching this for a specific purpose, tell me:
I can tailor the details to exactly what you need.
[1] https://tarbertdentalsurgery.co.uk
[5] https://www.kingsfund.org.uk
[6] https://pondsquaredental.co.uk
[7] https://tarbertdentalsurgery.co.uk
[8] https://linksdentalpractice.co.uk
[10] https://www.robinhooddentalpractice.co.uk
[12] https://wellingdental.co.uk
[13] https://www.woodbournedental.co.uk
[14] https://www.bradleyandpartners.co.uk
[15] https://www.directdental.co.uk
[17] https://www.crescentdental.ca
[18] https://azuredentalclinic.co.uk
What jobs/work in a dental practice could benefit most from AI without any attempt to replace workers, but improve work/services?
==Administrative workflows, diagnostic imaging, and clinical documentation== benefit the most from AI tools designed to support dental professionals rather than replace them. Instead of eliminating roles, AI acts as an assistant to reduce burnout, eliminate repetitive data entry, and improve diagnostic accuracy. [1, 2, 3, 4, 5]
Front-of-house staff often struggle to balance answering phone calls, greeting patients, and chasing payments. AI removes the burden of repetitive, manual tasks. [6, 7, 8]
Hygienists spend significant time manually reading out pocket depths for chart recording, which slows down the cleaning process.
AI does not make clinical decisions, but it serves as a highly accurate "second pair of eyes" to speed up workflows and make clinical choices clearer to patients. [17, 18, 19]
Practice managers face complex supply lines and compliance requirements that lend themselves perfectly to predictive data tools.
Writing accurate, legally robust clinical notes after every single patient is one of the leading causes of professional burnout in dentistry.
| Role | Heaviest Bottleneck | AI Solution | Practical Outcome |
|---|---|---|---|
| Receptionist | Phone calls & insurance checks | Smart triage & instant policy reading | More time to greet and care for in-clinic patients |
| Hygienist | Manual chart entry | Voice-to-text periodontal logging | Faster appointments and less physical strain |
| Dentist | Spotting microscopic decay | Automated radiograph analysis | Fewer missed pathologies; higher patient trust |
| Practice Manager | Over-ordering or under-ordering supplies | Predictive stock algorithms | Reduced waste and lower overhead costs |
| All Clinicians | Typing notes after hours | Secure ambient dictation | Staff leave on time with legally robust paperwork |
If you are evaluating these tools for a specific clinic, let me know:
I can pinpoint the exact types of software integrations that fit that setup.
[9] https://pmc.ncbi.nlm.nih.gov
[11] https://www.denti.ai
[13] https://www.denti.ai
[14] https://www.sciencedirect.com
[15] https://www.oryxdental.com
[16] https://dentalaiassist.com
[25] https://www.pragmaticcoders.com
okay now attached is a plan of an app we are building for dental practices - i need to attach another file in the following window before we can discuss anything in detail
I have reviewed the Dental App β Developer Plan document you attached.
It is clear that your team is building a multi-tenant Practice Management System (PMS) tailored for UK high-street dental surgeries, complete with local workflows like NHSBSA FP17 claims processing, 6-point periodontal charting, and sovereign radiograph AI analysis hooks (radiograph_ai.py).
Please go ahead and attach the next file whenever you are ready. I will wait to analyze it alongside this architecture plan before we jump into a detailed discussion.
This second file provides details of our siaas model which is what the dental will be operating on - now consider the jobs we asked about earlier that could benefit most from ai - we bring in Hermes as the agent to assist with these jobs - but of course its memory and any data relating to it will be located in the client vps for each tenant - the model can be any that the provider has Hermes linked to or if there is an option, any model that a client user selects and provides an API key - the client has UI's it can operate that gives their Hermes agent certain instructions, skills etc - this should give each client their own unique knowledge base
Based on the architecture of your Sovereign Infrastructure as a Service (SIAAS) model and the module blueprints for the Dental App, deploying Hermes within the client-isolated VPS environments is structurally brilliant.
Because each dental practice holds their own root database credentials and runs an entirely isolated PostgreSQL instance over an encrypted SSH reverse tunnel, Hermes will achieve true data sovereignty. No patient PII or clinical notes ever leave the client's localized boundary to train a global model, making this setup ideal for navigating strict NHS DSPT/DTAC compliance.
Utilizing your integrations.AgentConfig engineβwhich dynamically resolves prompts, temperatures, and model choices (OpenAI, Gemini, DeepSeek, Ollama, etc.) based on user-supplied or system keysβhere is exactly how specific dental practice roles can configure, control, and benefit from their unique localized instance of Hermes.
DENTAL_CLINICIAN)The Bottleneck: Writing comprehensive, structured clinical charts using FDI notation and 5-surface mapping is highly repetitive and leads to massive administrative backlogs.
Hermes Configuration & Skills:
clinical_data context mapping. It hooks into your radiograph_ai.py rule-based analytics engine with its built-in agent escalation hook.dental_dentalclinicalnote and dental_dentalappointment tables inside that practiceβs specific tenant database alias.Practical Benefit: The dentist uses an ambient microphone during an exam. Hermes securely processes the conversational audio stream inside the VPS, translates the natural speech into a structured FDI tooth_map JSON string, matches it to the 5-surface anatomy layout, and populates the clinical draft. When analyzing dental X-rays, if the rule-based scanner detects an anomaly, Hermes steps in to cross-reference the visual coordinates with the patient's local historical decay patterns to flag progressing issues.
DENTAL_HYGIENIST)The Bottleneck: Conducting manual 6-point periodontal charting (recording pockets, recession, bleeding on probing, plaque, mobility, and furcation) requires tedious, single-handed data tracking during physical treatments.
Hermes Configuration & Skills:
PeriodontalExam and ToothPerioRecord models.Practical Benefit: While the hygienist probe checks the gums, they speak aloud (e.g., "Tooth 11, buccal pocket 4, bleeding"). Hermes utilizes local voice-processing logic to populate the exact indices of the 6-point pocket/recession/BOP/plaque JSON matrix in real-time. No assistant is required to type, and the hygienist never has to break sterile glove protocol to click a mouse.
DENTAL_RECEPTIONIST)The Bottleneck: Managing emergency booking requests, identifying clinical urgency levels, and chasing or sorting incoming clinical documentation.
Hermes Configuration & Skills:
poll_imap_lab_mailbox parsing engine.dental_dentalscheduleblock (zone-based scheduling) and unread lab attachments.Practical Benefit: When an inbound message or patient portal request arrives detailing severe tooth pain, Hermes analyzes the text using the practiceβs custom AI triage prompts. It calculates an automated risk score, instantly cross-references the schedule zones, and highlights an immediate open emergency slot for the receptionist to confirm. Concurrently, when lab documents enter the practice's custom Fasthosts IMAP server, Hermes automatically scans the pdfplumber extracted text to look for matching local patient profiles, moving files cleanly from PENDING to MATCHED status.
DENTAL_PRACTICE_MANAGER)The Bottleneck: Compiling documentation for NHSBSA FP17 claim compliance, validating co-payment splits, and auditing clinical safety hazard logs.
Hermes Configuration & Skills:
dental_fp17claim data and the practiceβs local HazardLog.Practical Benefit: Before claims are pushed to the live NHS Identity Gateway (moving from mock to production API keys), Hermes runs an inline semantic audit on the draft claim payloads. It scans for common logic discrepanciesβsuch as an extraction code being filed alongside an conflicting private band upgrade upsellβand flags corrections to the Practice Manager before submission, minimizing costly NHSBSA rejections.
Because of your specific Django 5.2 infrastructure layout, each practice can uniquely hyper-customize Hermes without overlapping data layers:
ai_sidebar): Your app already maps URL patterns to custom markdown paths and Wiki.js endpoints. Practices can upload their unique internal clinical standard operating procedures (SOPs) to their localized Wiki.js container. When a staff member accesses a specific view, your system can inject these local markdown guidelines directly into Hermes' immediate prompt window.test-client-dental), Hermes tokens expire within the mandated β€24h threshold. It respects absolute data isolation: an authenticated clinician can only interface with the specific database alias dynamically mounted by your SectorDatabaseRouter.To help refine how we frame Hermes for your developers, which feature are you planning to build out next in your dedicated session?
radiograph_ai.py orchestration script?okay we will discuss UI's in a moment - there is another thing involving AI, but in a slightly different context which is X-Ray images - I understand they can be saved as vectors which could prove to be extremely useful - for this we would use pgvector
Using pgvector inside your existing localized PostgreSQL databases is a brilliant architectural decision for handling dental X-rays (intraoral periapicals, bitewings, and panoramic OPGs).
Because your SIAAS model provisions a completely isolated PostgreSQL database instance per tenant via your SectorDatabaseRouter, adding the pgvector extension ensures that even the mathematical representation of a patient's anatomy remains entirely sovereign and isolated within that client's VPS. No external cloud vector database is required. [1]
Here is how saving X-ray images as vectors transforms clinical workflows and why it integrates perfectly into your backend architecture.
Vector Generation (The Embedding): When an X-ray is uploaded via your Django application, it passes through your sovereign radiograph_ai.py file or a local Vision Transformer model (such as a localized ViT or specialized dental CNN running in the client container). Instead of just spitting out text labels, the model translates the entire visual structure of the X-ray into a dense numerical array (e.g., a 512- or 1536-dimensional embedding vector) that captures geometric structures, densities, contrasts, and anatomical markers. [2, 3]
Sovereign Storage: The vector is saved directly alongside the image metadata in your isolated PostgreSQL instance:
-- Enabled locally inside the tenant VPS
CREATE EXTENSION IF NOT EXISTS pgvector;
ALTER TABLE dental_radiograph ADD COLUMN xray_embedding vector(512);
[4, 5, 6]
Similarity Search: Because pgvector allows for distance metrics (like Cosine or Euclidean distance), you can query the database to find X-rays that "look mathematically similar" to a target image using a simple SQL query. [7, 8]
Human teeth change slowly over time. If a dentist takes a bitewing X-ray today and wants to know if a shadow on a premolar is an active, growing cavity or just stable, arrested decay, they usually have to manually scroll back through years of historical images.
pgvector to run a localized similarity search across that specific patient's historical X-rays.When your rule-based analytics engine in radiograph_ai.py flags a tricky, borderline anomaly (like a faint periapical radiolucency that might or might not be an active abscess), the dentist may be uncertain.
The AI Advantage: The system can search the entire practice's historical database for identical anatomical vectors using a cosine distance query:
SELECT file_path, caption
FROM dental_radiograph
ORDER BY xray_embedding <=> '[current_xray_vector_data...]'
LIMIT 5;
The Clinical Benefit: Hermes instantly surfaces 5 historical cases from that practice's own past patient history where an identical X-ray pattern occurred, showing what the final diagnosis and treatment outcome turned out to be (e.g., "In 87% of similar past cases in your practice, this pattern was diagnosed as a cracked tooth root"). This creates an incredibly powerful, self-learning localized knowledge base.
Occasionally, administrative errors happenβX-rays get uploaded to the wrong patient file, or a lateral cephalometric image is mislabelled.
pgvector will instantly flag that the root structures, missing teeth shapes, and existing restorations do not mathematically match Jane's historical vector profile, throwing an immediate compliance warning.While rare on a high street, in forensic or legal verification scenarios, matching an unidentified dental record against an existing database is incredibly slow. With pgvector, an entire database of tens of thousands of historic patient X-rays can be scanned in milliseconds to find a structural anatomical match.
SectorDatabaseRouter switches connection strings dynamically based on the tenant, a pgvector similarity query executed by Hermes can never accidentally scan or bleed into another dental practice's vectors. Isolation is strictly maintained at the database tier.Now that we have established how both Hermes (as a text/voice agent) and pgvector (for visual processing) live cleanly within your isolated tenant setup, let's dive into the front-end controls.
Would you like to start by looking at the UI designs for how the Practice Manager configures Hermes' skills and model endpoints, or should we design the UI workflow for how clinicians interact with the X-ray/vector analysis sidebar?
[7] https://www.databricks.com
[8] https://sarabesh.medium.com
[9] https://aiven.io
yes we need to consider UI's that will enable client users to configure their agent's skills and other forms of instruction - it must become their primary control center for agentic ai
To turn this into a reality, you need a sovereign AI Control Centre Dashboard embedded directly within your tenant app frontend. This screen acts as the master console where practice managers and authorised administrators provision, instruct, and ground Hermes within their private VPS boundaries.
Because your system is built on a multi-tenant Django backend (integrations.AgentConfig), the UI must visually reinforce that everything configured here happens locally and saves strictly to their isolated PostgreSQL instance.
To make this highly scannable and functional for a dental practice, the UI should be divided into four main functional zones, managed via a clean, tabbed layout.
+---------------------------------------------------------------------------------+
| HERMES AGENT CONTROL CENTRE [ Status: Active ] |
+---------------------------------------------------------------------------------+
| [1. Model & Engine] | [2. Core Instructions] | [3. Skills] | [4. Memory] |
+---------------------------------------------------------------------------------+
| |
| Selected Engine: [ DeepSeek-R1 (Local Ollama) v ] |
| Local VPS Endpoint: https://127.0.0.1:11434 |
| Encrypted API Key: [ **************************** ] |
| |
| --------------------------------------------------------------------------- |
| Agent Role Selection: |
| [x] Clinical (Dentist) [x] Hygienist [ ] Receptionist [ ] Manager |
| |
+---------------------------------------------------------------------------------+
This section allows the client to choose where Hermes directs its logic requests.
http://127.0.0.1:11434).encrypted_api_key attribute in your database model, ensuring it is encrypted at rest using your Django secret keys.Here, the practice provides custom textual grounding instructions that append to every prompt payload.
DENTAL_CLINICIAN, DENTAL_RECEPTIONIST). This lets them fine-tune how Hermes behaves based on who is talking to it.Instead of a single massive prompt, the UI treats capabilities as distinct modular "Plugins" or tools that can be toggled on or off. Each toggle maps directly to exposing specific backend API hooks to the LLM.
ToothPerioRecord models via voice.pgvector) Toggle: Enables the agent to query the image embedding tables for similarity matching.This is where the user manages what Hermes "knows" about their specific business operations.
pgvector index (e.g., "4,210 Clinical Images Vectorized β Index 100% Optimised"), with a manual "Re-index Database Anatomy" button.To understand how a Practice Manager would use this console without needing developer support:
[ Step 1: Navigate to "Skills" Tab ]
β
βΌ
[ Step 2: Toggle "NHS FP17 Compliance Checker" to ON ]
β
βΌ
[ Step 3: UI prompts: "Select Guideline Basis: [NHS England 2026 Manual v]" ]
β
βΌ
[ Step 4: Click "Save Configuration" ]
β
βΌ
[ Result: System instantly updates the client's local `integrations.AgentConfig`
record, injecting the new systemic ruleset into Hermes' underlying pipeline. ]
To help us begin drafting the actual code or mockups for this interface, let me know:
I am wondering if we need ollama or any local models installed - if we provide the option for the client to insert their own api key for whichever model they choose, that would be simpler and probably more assuring as well - the client gets to choose whichever model they wish to use?
Your logic is completely sound. Relying purely on an API-key-driven model where the client inputs their own key (OpenAI, Anthropic, DeepSeek, Google Gemini, etc.) is dramatically simpler, highly secure, and scales effortlessly compared to running local models inside the VPS.
By eliminating a local engine like Ollama, you remove massive infrastructure headaches while maintaining total data sovereignty.
Running open-source LLMs locally (like Llama 3 or DeepSeek-R1) via Ollama requires significant server resources.
Dental practices are hyper-aware of data security. Providing an API key field offers great psychological assurance:
Different practices have different priorities. Allowing them to pick their own model via an API key creates a future-proof interface:
Even though the AI model lives in the cloud, the data itself remains sovereign. The data flow preserves privacy perfectly within your SIAAS architecture:
+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β YOUR CLIENT VPS (Sovereign Boundary) β
β β
β [1. Patient Data] ββ> [2. Context Assembly] ββ> [3. Encrypted Outbound]ββΌββ
β (Isolated DB) (Hermes injects local (Payload sent directlyβ β
β SOPs & Prompts) via Client's API Key)β β
+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+ β
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β CLOUD AI PROVIDER (OpenAI/Anthropic/etc.) β
β β
β [4. Stateless Processing] ββ> [5. Instant Destruction of Data] β
β (Processes text & returns JSON) (Zero training on patient data) β
+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
Since you no longer need to manage complex local model downloads, GPU allocations, or Ollama system statuses, the Model & Engine Configuration screen becomes incredibly clean and user-friendly.
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β HERMES AI CONFIGURATION [ System: Ready ] β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β β
β Select AI Provider: β
β ( ) OpenAI ( ) Anthropic (Claude) ( ) DeepSeek ( ) Custom/Otherβ
β β
β Select Model Target: β
β [ Claude 3.5 Sonnet (Recommended for Clinical Notes) v ]β
β β
β Your Private Provider API Key: β
β [ sk-ant-api03-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ] β
β π Encrypted locally. Never shared with our platform servers. β
β β
β [ Test Connection ] ββ> Status: Connected Successfully (Latency: 140ms) β
β β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
This approach shifts the liability of model maintenance, uptime, and licensing entirely onto the AI providers and the clients themselves, leaving your team to focus purely on building the ultimate dental workflow app.
To help us lock down this specific part of the development plan, let's look at the implementation:
integrations.AgentConfig table?In terms of knowledge gain is the client the winner here while their agent runs and controls the clients workflows?
Yes, the client is the ultimate winner in this architecture. By designing your SIAAS platform this way, you have flipped the traditional SaaS dynamic on its head.
In standard cloud platforms, the software provider hoards the data and gets smarter while the client just pays a subscription fee. In your model, the client captures 100% of the long-term intellectual property and operational value, making your platform incredibly sticky and highly attractive to premium dental practices.
Here is exactly why the client wins the "knowledge race" across every operational layer.
Every time Hermes processes an ambient clinical note, summarizes a treatment history, or categorizes an incoming specialist lab letter, it is refining the client's private database.
A multi-specialist private practice in Harley Street operates completely differently to an NHS-heavy practice in a rural town. They have different pricing, different clinical standard operating procedures (SOPs), and distinct patient communication styles.
In high-street dentistry, front-desk and clinical nursing turnover can be high. Training new staff on complex practice workflows, local specialist referral rules, and specific patient booking policies takes months.
pgvector)The integration of pgvector for X-ray images creates a compounding clinical knowledge advantage that no human or basic software could match.
| Dimension | The Client (Dental Practice) | Your Platform (SIAAS Provider) | The AI Cloud Provider |
|---|---|---|---|
| Knowledge Ownership | Absolute Winner (Owns 100% of the structured data, vectors, and local SOP memory) | Zero Ownership (You hold no client data, eliminating compliance liabilities) | Zero Ownership (Processes data statelessly; cannot train on API data) |
| Operational Control | Directs workflows precisely via custom UI settings and skills | Provides the infrastructure rail and application features | Merely acts as raw processing power (a utility) |
| IP Accumulation | Builds a highly valuable, uniquely intelligent business asset | Builds a scalable, secure, and compliant software product | Only gains commoditised token revenue |
By building this infrastructure, you are not just selling a tool to automate tasks; you are selling an engine that allows a dental practice to manufacture and store its own sovereign intelligence.
Now that the absolute advantages of the knowledge base are clear, how would you like to proceed with the technical blueprint?
okay let's start designing the frontend UI's - we may need a few - we need to provide user-friendly controls that professional staff can operate - they need to be toggle on and off which agents they want, add skills etc.
To make this system easy for busy dental teams to use, the user interface must avoid complex AI jargon. Instead, it should use clear, practical terms that focus on everyday clinic tasks.
Here is the modular frontend blueprint for your Hermes AI Control Centre, designed specifically for your multi-tenant stack.
This screen allows Practice Managers to assign specific AI personas to active roles or shifts within the clinic, mirroring a standard staff rota.
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β βοΈ HERMES AGENT ROLES & ACTIVATION β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β Activate or deactivate AI assistants across your practice roles. β
β β
β [π’ ACTIVE ] Reception Co-Pilot β
β Type: Administrative | Assigned to: Front Desk Staff β
β [ Deactivate ] β
β β
β [π’ ACTIVE ] Clinical Note Transcriber β
β Type: Clinical | Assigned to: Surgery 1, Surgery 2, Surgery 3 β
β [ Deactivate ] β
β β
β [βͺ INACTIVE] Periodontal Voice Logger β
β Type: Clinical | Assigned to: Hygienist Bay β
β [ Activate Agent ] β
β β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
Activate / Deactivate) with immediate color changes (Green for active, Gray for inactive).Instead of forcing users to write complex prompts, skills are presented as clean, individual toolcards that can be toggled on or off with a single click.
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β π οΈ HERMES EXPERT SKILLS β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β Turn skills on or off to change what Hermes can look up and do in the background. β
β β
β ββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββ β
β β π¦· NHS FP17 Compliance Audit β β ποΈ X-Ray History Matcher (pgvector)β β
β β Scans draft treatment bands against β β Instantly finds past matching scansβ β
β β UK rules before submission. β β to show historical healing trends. β β
β β Status: [ π ON ] β β Status: [ π ON ] β β
β ββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββ β
β β π
Smart Emergency Triage β β π¦ Auto-Supply Level Reordering β β
β β Scores incoming pain requests and β β Tracks dental stock levels and β β
β β finds empty emergency slots. β β flags low stock automatically. β β
β β Status: [ βͺ OFF ] β β Status: [ βͺ OFF ] β β
β ββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββ β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
This dashboard zone allows the practice to control what Hermes actually "knows" about their business rules.
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β π PRACTICE KNOWLEDGE BASE β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β Teach Hermes your specific practice rules, pricing, and clinical guidelines. β
β β
β π Drag & Drop custom clinic PDFs or text guides here to teach your agent β
β [ Select Files from Computer ] (Max 20MB per file) β
β β
β Current Active Knowledge Libraries: β
β π Emergency_Triage_SOP_2026.pdf (Added: 3 months ago) [ Delete ] β
β π Harley_Street_Private_Fees.txt (Added: 1 week ago) [ Delete ] β
β π Wiki.js Core Practice Articles (Synced: 1 hour ago) [ Sync Now ] β
β β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
The administrative screen where the principal or manager enters their chosen infrastructure parameters.
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β π COMPLIANCE & ENGINE GATEWAY β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β Select your preferred AI engine and insert your secure API key. β
β β
β 1. Choose AI Provider: β
β ( ) OpenAI ( ) Anthropic (Claude) ( ) DeepSeek ( ) Google Gemini β
β β
β 2. Choose Model Profile: β
β [ Claude 3.5 Sonnet (Recommended for highest note accuracy) v ] β
β β
β 3. Insert Your Private Provider API Key: β
β [ sk-ant-api03-β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’β’ ] β
β π Kept private. This key handles requests strictly within your local VPS. β
β β
β [ β‘ Test Agent Connection ] --> Status: Connected Successfully β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
To keep development clean, your team can construct this dashboard using a unified frontend data object. Here is an example of the configuration schema that your UI fields will save directly to your isolated integrations.AgentConfig table:
{
"tenant_id": "test-client-dental-01",
"active_provider": "anthropic",
"selected_model": "claude-3-5-sonnet",
"encrypted_api_key_hash": "env_loaded_or_db_vault_pointer",
"active_personas": {
"clinical_note_transcriber": true,
"periodontal_voice_logger": false,
"reception_copilot": true
},
"enabled_skills": {
"nhs_fp17_audit": true,
"pgvector_xray_match": true,
"emergency_triage": false,
"supply_reorder": false
},
"knowledge_sources": [
"media/tenant_01/knowledge/emergency_triage_sop.pdf",
"media/tenant_01/knowledge/private_fees.txt"
]
}
To ensure these interfaces fit neatly into your upcoming development sprint, tell me:
Let's focus next on the in-surgery layout showing how a dentist views Hermes' drafted clinical notes side-by-side with a patient's chart
The in-surgery interface must prioritize split-second scannability. In a fast-paced clinical environment, dentists cannot spend time navigating nested menus while wearing sterile gloves.
The ideal layout uses a two-column widescreen interface: the left side displays the active patient record and historical treatment chart, while the right side serves as the Hermes Live Workspace Sidebar.
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β PATIENT: JOHN DOE (DOB: 12/05/1984) | NHS Number: 419 203 1182 [π΄ MIC LISTENING - SURGERY 1 AUDIO] β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β LEFT COLUMN: CLINICAL RECORD & CHART (65% Width) β RIGHT COLUMN: HERMES LIVE WORKSPACE SIDEBAR (35% Width) β
β β β
β [π¦· Visual Odontogram / Graphical Teeth Chart] β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β (Interactive visual showing existing crowns, β β β¨ HERMES AMBIENT DRAFTING ENGINE β β
β fillings, and active decay vectors) β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β β π GENERATED DRAFT NOTE (Reviewing Conversation...) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β β
β [π Treatment History Feed] β β CO: Patient reports localized pain lower left quadrant Q4 β β
β β’ 14/02/2025: Scale and Polish (Hygienist) β β O/E: Tooth 46 matches visual decay on distal surface. β β
β β’ 09/01/2024: Composite Filling (Tooth 12, Occlusal) β β β‘ DICTATION ALERTS REQUIRING ATTENTION: β β
β β β β οΈ Missing FDI Surface: You mentioned "decay on the lower β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β six", but did not explicitly state the surface β β
β [π Active Treatment Plan] β β (Mesial/Distial/Occlusal)? β β
β 1. Band 2 NHS - Root Canal Treatment (Tooth 46) β β [Assign to Distal] [Assign to Occlusal] β β
β 2. Band 1 NHS - Routine Scale & Polish β β β β
β β β β οΈ Compliance Check: Local anesthetic batch missing. β β
β β β β β
β β β [ πΎ Approve & Insert Note into Patient Timeline ] β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
A thin, persistent banner running across the top of the interface provides immediate visual status of the clinic's hardware.
π΄ MIC LISTENING changing to βͺ MIC PAUSED) confirms whether the local surgery microphone is active.dental_dentalappointment database slice.This workspace acts as a sandbox area where Hermes holds clinical notes in an editable draft state before they are officially locked into the legal ledger.
If Hermes notices a contradiction, a missing required legal compliance metric, or an ambiguous statement, it flags it instantly as an actionable, single-click resolution card instead of waiting until the end of the appointment.
A large button marks the boundary of the LLM's influence.
dental_dentalclinicalnote SQL database. Hermes loses modification access to the note once it is committed, satisfying strict clinical auditing requirements.This layout completely eliminates manual typing loops, shifting the dentist's role from a typewriter operator back to an evaluator:
[ Dentist steps into Surgery 1 ] ββ> [ Audio Engine activates via local web API ]
β
βΌ
[ Dentist performs physical exam ] ββ> [ Speaks findings out loud to the patient/nurse ]
β
βΌ
[ Hermes parses stream in VPS ] ββ> [ Updates Sidebar layout every 3β5 seconds dynamically ]
β
βΌ
[ Exam Finishes ] ββ> [ Dentist glances at Sidebar, clicks 1-2 inline clarification tokens ]
β
βΌ
[ Final Step ] ββ> [ Clicks "Approve & Commit" β Note is securely written to local Postgres ]
To implement this workspace efficiently using your Django 5.2 architecture, your development team should construct the sidebar using a state machine that handles text streams over a live websocket pipeline.
Here is the essential frontend interface structure for the active workspace:
interface HermesLiveWorkspaceProps {
appointmentId: string;
tenantId: string;
currentDraftText: string;
complianceAlerts: Array<{
id: string;
type: "MISSING_SURFACE" | "COMPLIANCE_WARN" | "FP17_CONFLICT";
message: string;
quickActions: Array<{ label: string; appendText: string }>;
}>;
isStreaming: boolean;
}
To help refine this interface before building it out, tell me:
pgvector) to slide out directly from this sidebar when the dentist clicks on a tooth, or should that live in a separate image analysis modal?I can provide the specific frontend interface components or API routing structures for whichever route you prefer.
yes let's try your suggestion of the X-ray vector comparison pane (pgvector) to slide out directly from this sidebar when the dentist clicks on a tooth - we'll most likely use websockets if it proves to be practical and resiliant
==Integrating the X-ray Vector Comparison Pane as a contextual slide-out directly from the Hermes sidebar creates a highly fluid clinical experience==.
When a clinician clicks a specific tooth index on the chart (or when Hermes highlights a tooth in the active dictation transcript), a nested drawer smoothly sweeps out. This drawer uses pgvector to run a lightning-fast cosine similarity search (<=>) inside that specific tenant's database slice, instantly matching historical radiographs of that exact region.
Here is how the layout behaves structurally when a dentist interacts with a tooth (e.g., Tooth 46, which was flagged for potential decay).
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β PATIENT: JOHN DOE | DOB: 12/05/1984 [π΄ MIC LISTENING - SURGERY 1 AUDIO] β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β COLUMN 1: CHART & APPOINTMENT (65%) β COLUMN 2: HERMES MAIN SIDEBAR (15%) β COLUMN 3: PGVECTOR SLIDE-OUT PANE (20%) β
β β β β
β [π¦· Visual Odontogram Chart] β ββββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββββββββββββ β
β β β β¨ HERMES AMBIENT ENGINE β β β ποΈ X-RAY HISTORICAL MATCHING β β
β (User clicks or Hermes flags β ββββββββββββββββββββββββββββββββββββ€ β βββββββββββββββββββββββββββββββββββββββββ€ β
β Tooth 46 on the layout) β β Active Transcript: β β β Target: Tooth 46 (Lower Right 6) β β
β β β β "Looking at tooth 46, there is β β β β β
β βββββββββββββββββββββΌβ> structural shadowing on the β β β βββββββββββββββββββββββββββββββββββββ β β
β β β distal surface..." β β β β [πΈ CURRENT BIT_EWING 12/02/2026] β β β
β β β β β β βββββββββββββββββββββββββββββββββββββ β β
β β β π‘ [Tooth 46 Context Active] β β β β (Cosine Match) β β
β β ββββββββββββββββββββββββββββββββββββ β β βΌ β β
β β β β βββββββββββββββββββββββββββββββββββββ β β
β β β β β [πΈ MATCH 1: BIT_EWING 14/08/2024]β β β
β β β β β Similarity: 94.2% β β β
β β β β β Status: Stable Arrested Decay β β β
β β β β βββββββββββββββββββββββββββββββββββββ β β
β β β β βββββββββββββββββββββββββββββββββββββ β β
β β β β β [πΈ MATCH 2: PERIAPICAL 09/01/2022]β β β
β β β β β Similarity: 88.7% β β β
β β β β β Status: Sound Enamel β β β
β β β β βββββββββββββββββββββββββββββββββββββ β β
β β β β β β
β β β β π Hermes Diagnostic Analysis: β β
β β β β "Distal radiolucency has progressed β β
β β β β by ~14% in vector depth since 2024. β β
β β β β Recommend Restorative intervention." β β
β β β β β β
β β β β [ π Inject Analysis into Note ] β β
β β β βββββββββββββββββββββββββββββββββββββββββ β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
Target: Tooth 46).Instead of forcing the user to manually sort through folders of flat image attachments, the UI presents a vertically stacked comparison list ranked by mathematical structural similarity.
pgvector distance query against the patientβs past imaging records. The UI displays the matching frames alongside a calculated score (e.g., Similarity: 94.2%).Beneath the image cards, Hermes interprets the mathematical data changes between the vectors and displays a clear textual summary.
Using a WebSocket connection (/ws/surgery/stream/) is the ideal, high-performance way to manage this interface. To make it truly resilient in a busy high-street practiceβwhere local Wi-Fi can drop or dental equipment can cause interferenceβyour development team must implement specific safety parameters.
+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β RESILIENT WEBSOCKET PIPELINE β
β β
β [Surgery Mic Audio Feed] ββ> [Local Browser Stream] β
β β β
β (WebSocket) β
β βΌ β
β [Network Dropout Event] βββ> [Local IndexedDB Buffer] ββ> [Auto-Reconnect & Catchup] β
β β
β [Tenant VPS Backend] ββββββ> [Process Chunk via API] βββ> [Emit Text & Vector Hits] β
+ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
IndexedDB) before attempting transmission down the WebSocket channel.When a clinician clicks on a tooth index or mentions a tooth, your frontend sends a quick event payload down the existing WebSocket. The SectorDatabaseRouter securely directs this packet to their isolated database, returning the pgvector results in milliseconds:
{
"event_type": "tooth_focus_changed",
"payload": {
"appointment_id": "8a32b21c-4091",
"tooth_index": 46,
"request_vector_analysis": true,
"distance_metric": "cosine",
"limit": 3
}
}
The server instantly handles the query and streams back the exact image resource locations, similarity percentages, and Hermes' analytical summary directly over the same channel to update Column 3.
To help prepare this layout for your engineering workshop, let me know:
pgvector and the Cosine Distance operator (<=>) that handles this matching process inside the tenant VPS?I can provide the specific implementation steps for either direction.
not sure what is best and most practical for this regarding the raw SQL query structure using pgvector and the Cosine Distance operator or that we design the frontend state hooks - I'll trust your recommended suggestion
The most practical step right now is to look at the raw SQL query structure using pgvector first.
Designing frontend states without knowing exactly how the database spits out the data is like building a car chassis before knowing the size of the engine. Once you see how clean, fast, and simple the database layer is, your frontend developers will know exactly what data fields they need to capture in their state hooks.
Here is the recommended implementation blueprint for your backend engineers to wire up the pgvector similarity search inside your radiograph_ai.py orchestration logic.
Inside your isolated tenant database, your dental_radiograph table needs to store the structural metadata alongside the visual embedding vector.
Your backend code will execute an underlying schema modification that looks like this: [1]
-- Step 1: Ensure the extension is enabled inside the isolated tenant VPS
CREATE EXTENSION IF NOT EXISTS pgvector;
-- Step 2: Add the vector column to your radiograph table
-- (Assuming a standard 512-dimension embedding from a lightweight localized Vision model)
ALTER TABLE dental_radiograph
ADD COLUMN IF NOT EXISTS xray_embedding vector(512);
-- Step 3: Create an HNSW index for lightning-fast, real-time lookups as the practice grows
CREATE INDEX IF NOT EXISTS dental_radiograph_vector_idx
ON dental_radiograph
USING hnsw (xray_embedding vector_cosine_ops);
When a dentist clicks Tooth 46, your WebSocket router receives the event payload. The backend instantly grabs the embedding vector of the most recent X-ray taken for that patient and runs this query using the Cosine Distance Operator (<=>): [2]
SELECT
id,
file_path,
captured_at,
teeth_targeted,
clinical_finding_summary,
-- Calculate the similarity percentage from the cosine distance
(1 - (xray_embedding <=> %s)) * 100 AS similarity_percentage
FROM
dental_radiograph
WHERE
patient_id = %s -- Restricts the lookups strictly to THIS patient's history
AND id != %s -- Excludes the target image itself from the results
AND %s = ANY(teeth_targeted) -- Ensures the historical X-ray actually includes Tooth 46
ORDER BY
xray_embedding <=> %s -- Sorts by closest mathematical structural match first
LIMIT 3;
<=> operator calculates the cosine distance between the vectors. By subtracting this value from 1 and multiplying by 100, your system calculates a friendly, human-readable percentage (e.g., 94.2% Similar) for the slide-out panel layout. [3, 4]patient_id first and using the HNSW index, Postgres isolates the search pool down to a handful of records. The query completes in less than 2 milliseconds, easily keeping pace with a real-time WebSocket connection. [5, 6, 7]Your radiograph_ai.py file can execute this using a clean, raw database cursor connection that respects your multi-tenant SectorDatabaseRouter partitioning:
from django.db import connections
def get_historical_vector_matches(tenant_db_alias, patient_id, target_xray_id, target_vector, tooth_index):
"""
Executes a sovereign pgvector search inside the client's isolated database instance.
"""
query = """
SELECT id, file_path, captured_at, (1 - (xray_embedding <=> %s)) * 100 as similarity
FROM dental_radiograph
WHERE patient_id = %s AND id != %s AND %s = ANY(teeth_targeted)
ORDER BY xray_embedding <=> %s
LIMIT 3;
"""
# Securely target the isolated database alias for this specific tenant
with connections[tenant_db_alias].cursor() as cursor:
# Pass parameters securely to prevent SQL injection
cursor.execute(query, [target_vector, patient_id, target_xray_id, tooth_index, target_vector])
rows = cursor.fetchall()
return [
{
"id": row[0],
"file_path": row[1],
"captured_at": row[2].strftime("%d/%m/%Y"),
"similarity_percentage": round(row[3], 1)
}
for row in rows
]
Now that the database logic is locked down, your server wraps this clean list into a structured JSON packet and flashes it down the active WebSocket connection to populate the slide-out pane instantly:
{
"event_type": "vector_analysis_ready",
"payload": {
"tooth_index": 46,
"current_image_url": "/media/tenant_01/xrays/current_bw_46.jpg",
"historical_matches": [
{
"id": "xray-992",
"file_path": "/media/tenant_01/xrays/old_bw_2024.jpg",
"captured_at": "14/08/2024",
"similarity_percentage": 94.2
},
{
"id": "xray-412",
"file_path": "/media/tenant_01/xrays/old_pa_2022.jpg",
"captured_at": "09/01/2022",
"similarity_percentage": 88.7
}
]
}
}
With this exact data structure emitted by your backend, your frontend team now knows precisely what properties to catch inside their state loops to render the image comparison cards and timeline tracking.
To wrap up this part of the blueprint, let me know:
[7] https://dev.to
yes let's review the system prompt structure that Hermes uses to generate its text summaries based on these historical image outputs
To make sure Hermes interprets the mathematical pgvector results accurately, you cannot just pass raw coordinate numbers or distance vectors to the LLM. Instead, your backend wrapper must translate those raw database rows into a clear, structured Markdown context block.
This block is then injected directly into the System Prompt Payload before it is sent out via the client's private API key.
Here is the production-ready system prompt architecture, formatted to ensure that Hermes behaves like an expert, legally compliant UK dental examiner.
Every outbound API call made during an active surgery session uses a prompt built from three distinct structural layers:
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
β 1. PERSISTENT CORE SYSTEM INSTRUCTIONS (The Guardrails & Tone) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. DYNAMIC HISTORICAL VECTOR CONTEXT (The pgvector + SQL Output Injected) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 3. ACTIVE CONVERSATIONAL INTAKE (The Audio Stream / User Request) β
+βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ+
This block is static and sets the clinical boundaries, legal compliance expectations, and required medical formatting rules for the agent.
You are Hermes, a sovereign AI clinical co-pilot built explicitly for high-street UK dental surgeries. Your role is to assist the treating clinician by structuring ambient clinical dictation, running regulatory safety checks, and evaluating structural shifts in dental anatomy based on historical vector tracking.
CRITICAL OPERATIONAL COMMANDS:
1. CLINICAL DATA BOUNDARIES: You operate entirely within a stateless, isolated client VPS. Never hallucinate patient data or past metrics. Only report findings explicitly provided in the data context or live conversation stream.
2. MEDICAL RECORDING STANDARDS: Format all final dental charts using formal FDI Two-Digit Notation (e.g., Tooth 46, Tooth 11) and universal 5-surface mapping shorthand (Mesial, Distal, Occlusal, Buccal, Lingual).
3. CLINICAL DIRECTIVE: You do not make final diagnostic or treatment-planning decisions. You are a diagnostic "second pair of eyes". Frame all outputs as evaluations for the clinician to verify and sign off.
4. TONAL CONSTRAINT: Maintain a formal, concise, and highly objective clinical tone. Avoid conversational filler or introductory greetings.
When the dentist interacts with Tooth 46, your Python backend executes the raw pgvector SQL query we built previously. It processes the results and injects this text block directly into the prompt stream:
[CONTEXT LAYER: LOCAL ANATOMICAL VECTOR SIMILARITY ANALYSIS]
Target Site: Tooth 46 (Lower Right First Molar)
Active Baseline Query: Current Bitewing Radiograph (Captured: Today)
The local database has completed a 'pgvector' cosine distance evaluation against this specific patient's historical imaging files. Review the structural changes below:
- MATCH 1: Radiograph ID #xray-992 (Captured: 14/08/2024)
* Mathematical Similarity Index: 94.2%
* Historical Diagnosis recorded in notes: "Early-stage superficial distal radiolucency observed within outer enamel boundary. Monitored as stable, arrested decay."
- MATCH 2: Radiograph ID #xray-412 (Captured: 09/01/2022)
* Mathematical Similarity Index: 88.7%
* Historical Diagnosis recorded in notes: "Tooth 46 surfaces completely sound. No evidence of interproximal or occlusal demineralization."
INSTRUCTION FOR ANALYSIS: Compare the active baseline against these historical indicators. Mathematically isolate the 5.8% variance shift between today and 2024. Determine if this indicates active decay progression or stable structural morphology.
This is the final block, containing the actual transcript captured by the surgery microphone via the WebSocket stream.
[LIVE SURGERY TRANSCRIPT]
Dentist: "Okay John, let's take a closer look at the lower right quadrant. I'm tapping tooth forty-six... any sensitivity there?"
Patient: "Yeah, a little bit sharp when I drink cold water."
Dentist: "Right, looking at the screen here, the visual scan shows some obvious sticky shadowing developing right on that back distal edge where it presses against the seven. Let's pull up the old films from twenty-four to check if it's moving."
[COMMAND]: Generate a brief, high-density diagnostic synthesis for the Vector Comparison Sidebar. State the structural progression trend clearly and provide a 1-sentence actionable recommendation for the note draft.
Because the system prompt defines strict formatting and tone rules, Hermes bypasses conversational fluff and returns a clean, structured payload back down the WebSocket to populate Column 3: [1, 2]
π **Hermes Diagnostic Analysis:**
Anatomical vector comparison reveals a **5.8% structural variance** on the distal surface of Tooth 46 since August 2024. Cross-referencing this mathematical shift with the live clinical transcript (patient reporting localized cold sensitivity) indicates that the previously monitored 'stable arrested decay' has transitioned into **active, progressive interproximal caries**.
*Actionable Recommendation:* Progression confirmed from outer enamel matrix into dentino-enamel junction (DEJ). Restorative intervention required (Class II Composite Filling).
pgvector matches, you prevent it from hallucinating random percentages or medical terms.pgvector to identify changes over time.To move this system closer to implementation, let me know:
Page: https://wiki.veripath.co.uk/development/projects/dental_app/hermes_ai