← All articles
Italiano · Español
01001101 01000101 01000100 01001001 01001100 01001111 01000111
01000001 01000111 01000101 01001110 01010100 01010011 00100000
S O L V E I
Studio · Ostinatamente · Le · Veloci · Evoluzioni · Informatiche
Innovative Applicative Software
Solvei logo
MediLog logo
Stefano Berrettini
Stefano Berrettini Creator
AI Platform
solveiAgents
Open AI Platform

Twelve agents.
One network.
A system that never sleeps.

From a Next.js interface to a FastAPI orchestrator, down to a constellation of specialized agents running locally — and on top of it all, MediLog: the electronic health record a click away.

June 2026 Version 1.0
In short

solveiAgents is a multi-agent AI platform that runs entirely on private hardware, with no sensitive data sent to third-party cloud services: a FastAPI orchestrator coordinates twelve specialized agents, each powered by open-weight models running locally via Ollama. MediLog, the flagship module, is the full electronic health record — DICOM imaging with an OHIF viewer, multimodal patient chat, and telemedicine over mediasoup.

The vision

An AI infrastructure that lives under your own roof

solveiAgents is a multi-agent AI platform designed to run entirely on private hardware or a VPS — with no sensitive data sent to third-party cloud services. A modern web interface talks to a central orchestrator, which in turn coordinates a team of specialized agents: each with a precise domain, each powered by open-weight language models running locally via Ollama.

The architecture follows a simple principle: a specialized agent always beats a generalist. A model trained to reason over medical reports isn't the same one that analyzes financial markets. An agent that knows your personal wiki produces different results from one randomly browsing Wikipedia. Specialization isn't a limitation — it's a quality choice.

The founding principle

Picture a teaching hospital. There's no single doctor who knows everything: there's the cardiologist, the radiologist, the neurosurgeon, the GP. And there's the chief physician coordinating them all. solveiAgents works exactly the same way — just for your digital workflow. Every agent excels in its own domain, and the orchestrator always knows who to ask.

Platform architecture
Next.js
User interface
→
FastAPI Orchestrator
Coordinator LLM · Clerk Auth
→
Financial
Wiki
Medical
Images
Video
News
Blog
Docling
The specialized team

Twelve minds, one goal

The platform today includes twelve operational agents, each exposed on its own dedicated port and woken on demand by the orchestrator. This on-demand principle avoids wasting resources: agents sleep until needed, wake up in a few seconds, and go back to sleep after a period of inactivity. Every agent, and every shared infrastructure service, lives in its own Docker container.

:8001 Financial — portfolio analysis, markets, financial news
:8002 Wiki — company knowledge base with OCR and a concept graph
:8003 Medical — scientific literature, clinical analysis, FHIR
:8004 Images — visual analysis, description, classification
:8005 Video — transcription, analysis, video summarization
:8010 News — aggregation, summarization, sentiment from multiple sources
:8012 Blog — SEO article generation with built-in Hugo CMS
:8014 Docling — PDF/DOCX/XLSX/PPTX/HTML → Markdown conversion
:8015 PHR — medical record, DICOM, FHIR, patient chat
:8016 Whisper — audio transcription with faster-whisper large-v3-turbo
🏠 Privacy by design

All LLMs run locally via Ollama. Data — especially health data — never leaves the server. Nothing is sent to OpenAI, Anthropic, Google, or any other cloud provider. For features that do require a connection (scientific literature, financial news), the only data transmitted is anonymized text queries.

"Real distributed intelligence isn't about having a bigger model — it's about having the right model for every task."
Solid foundations

The stack holding it all up

Every component of the platform is chosen for specific reasons: reliability, interoperability with open standards, and the ability to run without mandatory cloud dependencies.

Frontend

Interface and access

  • Next.js 14 with App Router and React Server Components
  • Clerk for multi-app authentication (agents + medilog)
  • Tailwind CSS with shadcn/ui and design tokens
  • WebSocket for real-time response streaming
  • nginx with SSL/TLS termination and per-vhost routing
Backend

Orchestration and agents

  • FastAPI + async SQLAlchemy for every service
  • PostgreSQL with separate schemas (phr, ref, fhir)
  • Alembic for controlled database migrations
  • MinIO for object storage (documents, images)
  • Grafana + Prometheus + Loki for full observability
✦
Flagship module · Electronic Health Record

MediLog — the PHR that
thinks with you

Not just a patient registry. A complete clinical platform with built-in AI: from data collection to video consultations, from analysis of lab reports to DICOM archiving, all in one open-source system that runs locally and respects the privacy of health data.

29+ DB Migrations
160k AIFA Drugs
16k ICD-9-CM Codes
140+ Automated Tests
Clinical core

A Complete Medical Record

The heart of MediLog is the phr schema in PostgreSQL: patients, allergies, clinical events coded with Italy's ICD-9-CM, drug therapies mapped to AIFA medications, daily observations, attached documents, and DICOM studies — all linked together and queryable.

👤

Patients and Medical History

Patient management with demographic data, family history, allergies (drugs/food/environment), and therapies with dosage, frequency, and AIFA medication.

📅

Clinical Timeline

Chronological timeline of events with ICD-9-CM code, description, dates, and pinned documents/DICOM studies. Interactive calendar view.

📄

Document Archive

Document upload (PDF, images, audio, Markdown) with MinIO storage. Automatic OCR via Docling, AI summaries, full-text search across every entity.

🔍

Global Search

A unified GET /search?q= across patients, events, documents, medications, facilities, ICD-9-CM. Accessible from the top bar with Enter.

📋 Built-in reference data

MediLog ships with ready-made loaders for: AIFA medications (~160k entries, reimbursement tiers A/C/SOP/H/OTC), AIFA healthcare facilities (~3.3k, cp1252 encoding), the Ministry of Health's ICD-9-CM (~16.2k codes, a non-standard format parser), LOINC for lab analytes. All updatable via the POST /phr/admin/ref/update admin endpoint.

Diagnostic imaging

Native DICOM with an OHIF viewer

Imaging studies (X-ray, CT, MRI, ultrasound) are loaded straight into the system via folder upload — even with extension-less files. Orthanc handles DICOM storage with deduplication by StudyInstanceUID: re-uploading a study that's already there updates the series count instead of creating duplicates.

The viewer OHIF is served directly by nginx — reachable from both agents.solvei.it and medilog.solvei.it — with Clerk authentication through the internal auth-validator. The viewing URL is built on the frontend from window.origin + StudyInstanceUID, using relative dicom-web paths.

Clinical integration

Every DICOM study can be pinned to the clinical timeline: a CalendarPlus icon on each study row opens a dialog letting you link the study to an existing event or create a new one. In the timeline, the DICOM badge is clickable and opens the OHIF viewer directly.

AI clinical assistance

Patient chat with multimodal analysis

The built-in clinical chat isn't a generic chatbot: it reads the patient's record, reads the attached documents, analyzes DICOM images with vision models (qwen3-vl), and consults international scientific literature — PubMed, Europe PMC, Semantic Scholar — attaching cited sources with links directly to open-access full text.

The technical flow: agent-phr prepares attachments from MinIO/Orthanc into a shared /data/uploads folder and proxies them to agent-medical via SSE streaming. The Clerk token is refreshed on every request via registerTokenGetter — avoiding the 60-second cached-token issue that caused silent 401s.

🧠

Visual DICOM analysis

A doctor can ask "tell me what you see in this ultrasound" — the chat analyzes DICOM images with qwen3-vl via Ollama. Multi-frame sequences supported.

📚

Scientific literature

The cite_sources flag: every answer about a diagnosis or therapy is enriched with links to relevant open-access PubMed/PMC publications.

🔬

Natural-language lab queries

"Show me my last 5 glucose readings" — /labs/parse-query interprets the natural-language request and retrieves the matching LOINC values.

📎

Contextual attachments

MinIO documents and Orthanc studies are automatically prepared and staged before every call to the vision model.

Lab analysis

Structured extraction from lab reports

Upload a blood-test report as a PDF or image — MediLog processes it with OCR Docling, then sends it to agent-medical for structured value extraction: analyte name, numeric value, unit of measure, reference range, LOINC code. The result is presented in an interactive review before saving — the clinician can correct wrong values or add notes.

Saved values feed the Labs view with recharts graphs for each analyte over time. Over 60 analytes supported in the LOINC mapping: glucose, complete blood count, kidney and liver function, lipids, thyroid hormones, cardiac markers, coagulation, vitamin D, HbA1c, D-dimer.

🏷️ The LOINC and UCUM standards

Every observation is coded according to LOINC (Logical Observation Identifiers Names and Codes) and UCUM (Unified Code for Units of Measure). Values can also be exported as FHIR R4 Observation resources to HAPI FHIR. The reference range is automatically parsed from Italian-language formats ("from X to Y", "< 200", "above 60").

Telemedicine

Video visits with mediasoup SFU

MediLog includes a complete SFU video-call system (Selective Forwarding Unit) built on mediasoup 3.20 — the same technology used by Zoom and Teams, but running locally with no cloud dependencies.

Waiting room
The patient creates a room (phr.call_rooms) and shares the link. The doctor joins with a unique guest token — no Clerk account required.
In the call
Bidirectional video + audio, screen sharing (replaceTrack on a single video producer — compatible with every browser), late-join onto existing producers, automatic stale-peer eviction.
Recording
Server-side recording via PlainTransport + ffmpeg. Audio-only or audio+video, your choice. When it ends, the file is automatically transcribed by agent-whisper (faster-whisper large-v3-turbo) and saved as a document with an editable transcript.
Infrastructure
agent-call on Node.js 22 (:2000) + coturn TURN server (:3478, network_mode:host). MEDIASOUP_ANNOUNCED_IP = a real LAN IP (critical: never 127.0.0.1 — Docker Desktop doesn't forward UDP to loopback).
Clinical interoperability

FHIR R4 and the IPS Patient Summary

All of MediLog's clinical data is available in FHIR R4 format through HAPI FHIR (:8080). The Patient Summary compliant with the IPS (International Patient Summary) standard is generated as a Bundle FHIR and includes: Patient, AllergyIntolerance, MedicationStatement, Condition (ICD-9-CM → mapped to ICD-10 for FHIR), Observation (LOINC lab values), DocumentReference for attached documents.

The endpoint GET /phr/fhir/bundle generates the bundle on demand. FHIR data is also covered by the daily pg_dump backup — since HAPI runs on the same PostgreSQL (currentSchema=fhir).

Reliability in production

Always-on, reboot-proof, backup

The daily backup (3:00 UTC) covers everything: the relational PostgreSQL database via pg_dump (phr/ref/fhir schemas), MinIO blobs (documents and images), and Orthanc studies — all mounted read-only in the orchestrator container and archived to the host folder ./data/backups.

✦
Technology stack

All the software powering the platform

Infrastructure:

nginx Docker Compose PostgreSQL 16 Alembic MinIO Grafana Prometheus Loki

Backend:

FastAPI SQLAlchemy async Pydantic v2 Ollama faster-whisper Docling HAPI FHIR Orthanc DICOM

Frontend:

Next.js 14 React 18 Clerk Auth v5 Tailwind CSS shadcn/ui Recharts OHIF Viewer

Real-time communication:

mediasoup 3.20 socket.io coturn WebRTC SSE streaming WebSocket
🚀 What's next

In progress: an OCI A10.1 GPU VM in Frankfurt for accelerated vision inference (qwen3-vl:4b currently runs partly on CPU → ~5 min/study; target <30s on the A10). Architecture decided: always-on CPU (small Ollama models) + an on-demand GPU with billing paused on stop, inside a private OCI VCN with no PHI data ever leaving the region.

▶ Demo
solveiAgents in action — demo video
The solveiAgents platform at work: orchestrator, specialized agents, and MediLog PHR in a complete demo.