MakerAI Suite v3.6 — The AI Ecosystem for Delphi

🌐 Official Website: https://makerai.cimamaker.com 📖 Manual: https://www.gustavoenriquez.com/book-makerai — available in English and Spanish

GitHub Stars GitHub Issues License Telegram Delphi Supported Versions Free Pascal

Free Pascal / Lazarus port available — Full port of MakerAI Suite for FPC 3.2+ (12 LLM drivers, RAG, Agents, MCP, Embeddings). See the fpc branch.


MakerAI is more than an API wrapper

Most AI libraries for Delphi stop at wrapping REST calls. MakerAI is different.

Yes, MakerAI includes native, provider-specific components that give you direct, full-fidelity access to each provider's API — every model parameter, every response field, every streaming event, exactly as the provider defines it.

But on top of that, MakerAI is a complete AI application ecosystem that lets you build production-grade intelligent systems entirely in Delphi:

  • RAG pipelines (vector and graph-based) with SQL-like query languages (VQL / GQL)
  • Autonomous Agents with graph orchestration, checkpoints, and human-in-the-loop approval
  • MCP Servers and Clients — expose or consume tools using the Model Context Protocol (dual-era: stateless spec 2026-07-28 + legacy handshake)
  • Native ChatTools — bridge AI reasoning with deterministic real-world capabilities (PDF, Vision, Speech, Web Search, Shell, Computer Use)
  • FMX Visual Components — drop-in UI for multimodal chat interfaces
  • Universal Connector — switch providers at runtime without changing your application code

Whether you need a simple one-provider integration or a multi-agent, multi-provider, retrieval-augmented production system, MakerAI covers the full stack — natively in Delphi.


🚀 What's New in v3.6

MCP Specification 2026-07-28 — Stateless, Dual-Era

The Model Context Protocol dropped sessions and the initialize handshake. MakerAI implements the new stateless revision on both sides and keeps talking to legacy peers: clients probe with server/discover and fall back automatically; the server serves modern per-request _meta requests statelessly while the legacy handshake and session gating keep working. Includes the MRTR pattern, so a tool can pause and ask the user for confirmation (OnInputRequired on the client, TAiAuthContext.InputResponses on the server).

Observability — OpenTelemetry Tracing

TAiTelemetry exports OTLP traces to any standard collector (Jaeger, Grafana Tempo, Langfuse, Arize Phoenix) following the GenAI semantic conventions. Spans cover chat turns with token usage, tool executions, agent graphs and nodes, RAG retrieval and MCP requests — with W3C traceparent propagated through MCP _meta, so a client and a server in different processes share one distributed trace. Opt-in, zero overhead when disabled.

A2A — Agent-to-Agent Protocol (first Delphi implementation)

If MCP is the agent-to-tool layer, A2A (Linux Foundation) is the agent-to-agent layer. TAiA2AServer publishes any agent graph as a standard A2A agent (Agent Card + JSON-RPC), TAiA2AClient consumes remote agents, and TAiA2ARemoteAgentTool federates: a node in your graph can delegate its work to a remote agent — including one written in another language or framework. Demo: 072-A2AFederation.

Guardrails & Evals

TAiGuardrails intercepts every tool call before it executes (allowlists, blocklists, forbidden argument patterns, programmatic veto) — blocked calls never run and the LLM gets the reason so it can replan. TAiEvalRunner brings systematic evaluation: fluent test cases against any target, deterministic checks plus optional LLM-as-judge, with ToJSON reports for CI.

First Automated Regression Suite

Tests/RegressionSuite/ — 17 in-process cases covering MCP, agents, A2A, guardrails and evals. No API keys, under a second, exit code for CI. Built on TAiEvalRunner itself.


What's New in v3.5

Typed ModelConfig Channel

Capability configuration now lives in a single typed surface: ModelConfig.ModelCaps / SessionCaps / Tool_Active / ThinkingLevel moved out of the string-based Params/RTTI channel, with per-field user pins and transparent compatibility migration — existing code keeps working unchanged.

Full-Duplex Voice Suite

  • TAiGrokRealtimeChat — xAI Grok Voice speech-to-speech (function calling, session resumption with replay, binary audio transport, ephemeral tokens)
  • TAiOpenAiRealtimeTranslate — continuous streaming speech translation (one WebSocket per direction; demo 071-VoiceBridgeTranslate)
  • TAiRealtimeVoiceBase — shared full-duplex base; voice events flow through the universal TAiRealtimeConnection
  • gpt-transcribe / gpt-live-transcribe — OpenAI's Whisper successors, fully integrated

August 2026 Provider Refresh — All 9 Cloud Providers, Runtime-Tested

Claude 5 family (adaptive thinking, FastMode, compaction, server-side fallbacks) · Gemini 3.5/3.6 + Nano Banana GA · Mistral Voxtral TTS + OCR 4 · Kimi K3 · DeepSeek V4 (explicit thinking control) · Cohere Command A+ · Groq qwen3.6 · xAI grok-4.3/4.5/build — with retired-model cleanup and compatibility aliases throughout.

Grok Native Video & Image Generation

TAiGrokChat now generates video with grok-imagine (async job + polling + mp4 as TAiMediaFile, new VideoDurationSeconds property) and images with grok-imagine-image — activated by cmVideoGeneration/cmImageGeneration or the [cap_GenVideo]/[cap_GenImage] gaps.


What's New in v3.4

Delphi 13.1 Florence Support

v3.4 is fully tested and compatible with Delphi 13.1 Florence (CompilerVersion 37.1), in addition to the existing range from Delphi 10.4 Sydney through Delphi 13 Florence.

Selective Driver Registration

The biggest infrastructure change in v3.4: TAiChatConnection no longer force-loads all providers at startup. Each driver now self-registers only when explicitly imported, eliminating unnecessary initialization overhead:

// Load only what you need
uses uMakerAi.Chat.AiConnection, uMakerAi.Chat.OpenAi, uMakerAi.Chat.Claude;

// Load all drivers at once (legacy behavior)
uses uMakerAi.Chat.Initializations;

Real-Time STT — TAiRealtimeConnection

New universal connector for real-time speech-to-text via WebSocket:

  • TAiRealtimeConnection — provider-agnostic STT connector; switch providers via DriverName
  • TAiOpenAiRealtimeSTT — full OpenAI Realtime API implementation (24 kHz PCM16, VAD modes, streaming transcription)
  • Pure-Pascal WebSocket client with native TLS via Windows SChannel — no extra DLLs required
  • Thread-safe PCM16 resampler; supports push-based audio streaming from any source

GPT-Transcribe — Next-Gen OpenAI Transcription (Whisper successors) 🆕

OpenAI's new transcription models (Aug 2026) are fully integrated — better accuracy on real-world audio, accents, numbers, specialized terminology and loud background noise:

Model Use case Word Error Rate
gpt-live-transcribe Live low-latency STT (Realtime WebSocket) 9.60% (vs 11.65% Whisper)
gpt-transcribe Completed files and batch workloads 8.98% (vs 15.21% Whisper)
  • TAiOpenAiRealtimeSTT now defaults to gpt-live-transcribe, with new context properties: TranscriptionPrompt (free-form topic), TranscriptionKeywords (domain terms), Languages (multi-language guided autodetection) and LowDelay
  • TAiOpenAiAudio gains tmGptTranscribe / tmGptLiveTranscribe with TranscriptionKeywords + TranscriptionLanguages for REST/batch transcription
  • Legacy models (whisper-1, gpt-4o-transcribe) remain available — they're still required for subtitles (SRT/VTT), word timestamps and diarization (gpt-4o-transcribe-diarize), which the new models don't support; the components degrade formats safely per model
  • VoiceBridge demos (062–065) migrated: live channels use gpt-live-transcribe with contextual prompts and guided language detection; diarized channels stay on gpt-4o-transcribe-diarize

Grok Voice — Real-Time Speech-to-Speech (xAI) 🆕

Full-duplex voice conversation with xAI's Grok Voice models (grok-voice-think-fast-2.0) over a single WebSocket — the user speaks, Grok listens, reasons and answers back with voice:

  • TAiGrokRealtimeChat — complete driver for wss://api.x.ai/v1/realtime (OpenAI Realtime-compatible protocol, 24 kHz PCM16)
  • TAiRealtimeVoiceBase — new base class for full-duplex voice drivers; adds OnAssistantText, OnAssistantTextDelta, OnAudioChunk, OnAudioDone (shared with TAiMakerAiRealtimeChat)
  • Live user transcription (OnTranscriptDelta / OnTranscriptCompleted), server VAD, streamed assistant text and TTS audio
  • Function calling by voice: assign a TAiFunctions component (local functions + MCP) and Grok invokes your Delphi code mid-conversation — the driver handles the whole round-trip (execution on worker threads, function_call_output, continuation)
  • xAI native tools: EnableWebSearch / EnableXSearch — executed server-side by xAI
  • Session options: Voice (eva, ara, rex, sal, leo or custom voice_id), Instructions, ReasoningEffort (high / none for lower latency), OutputSpeed, Keyterms (transcription biasing), PronunciationReplace (TTS corrections), automatic regional language hints (eses-MX, ptpt-BR)
  • ForceMessage() — scripted TTS utterance bypassing the model (IVR prompts, disclosures)
  • Session resumption: EnableResumption + ConversationId — reconnect and the server replays the cached turns (transcripts, tool calls and outputs; 30-min window)
  • Binary audio transport: BinaryAudio := True — raw PCM over WebSocket binary frames, ~33% less bandwidth than base64
  • Ephemeral tokens for mobile/browser clients: MintEphemeralToken() on your backend + EphemeralToken on the client — the API key never leaves the server
  • file_search over xAI Collections (FileSearchCollections) and remote MCP servers via CustomToolsJson
  • Works through TAiRealtimeConnection too — just set DriverName := 'Grok'
uses uMakerAi.Realtime.AiConnection, uMakerAi.Realtime.Grok;

Voice := TAiRealtimeConnection.Create(nil);
Voice.DriverName   := 'Grok';
Voice.ApiKey       := '@GROK_API_KEY';
Voice.Language     := 'es';
Voice.OnTranscriptCompleted := HandleUserText;   // what the user said
Voice.OnAssistantText       := HandleGrokText;   // what Grok answered
Voice.OnAudioChunk          := HandleGrokAudio;  // Grok's voice (PCM16 24 kHz)
Voice.Connect;
// ... stream microphone audio via Voice.SendAudioChunk(Data) ...
// For file-based audio (non-continuous), close the turn explicitly:
// Voice.CommitAudio; TAiGrokRealtimeChat(Voice.Instance).CreateResponse;

cmSmartDispatch — Intelligent Chat Routing

New ChatMode value for automatic two-pass routing:

  • Pass 1 — classifies the user intent and rewrites the prompt for the target capability (image generation, speech synthesis, web search, etc.)
  • Pass 2 — dispatches to the appropriate bridge or tool based on classification
  • Works with all existing ChatTools (IAiImageTool, IAiSpeechTool, IAiWebSearchTool, etc.)

Models Updated (May 2026)

Provider New / Updated Models
OpenAI gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-image-1
Claude claude-opus-4-7 (Adaptive Thinking), claude-sonnet-4-6, claude-haiku-4-5
Gemini gemini-3.1-pro, gemini-3-flash, gemini-3.1-flash-lite, gemini-3.1-flash-image
Grok grok-4-fast, grok-3, grok-code-fast-1
Mistral magistral-medium/small, devstral, voxtral
Groq llama-4-scout/maverick, kimi-k2, qwen3, compound-beta
Kimi kimi-k2, kimi-k2.5, kimi-k2-thinking
Cohere command-a-03-2025, command-a-reasoning, command-a-vision

Agent Improvements

  • TAiAgentManager.Run declared virtual — proper subclassing now supported
  • jmAll join node fixFJoinInputs cleared after each execution; eliminates premature firing on retries and loops
  • TChatInput.EnterAsSend — new property (default False): Enter sends the prompt, Shift+Enter / Ctrl+Enter inserts a line break
  • TChatBubble — eliminated spurious vertical scrollbar (ShowScrollBars := False)

Bug Fixes

  • Claude Opus 4.7 Adaptive Thinking — temperature, top_p, top_k and the thinking block are now correctly omitted for claude-opus-4-7 models. Anthropic manages sampling internally for these models; sending these parameters caused HTTP 400 errors.
  • RegisterDefaultParams — Max_Tokens key — corrected in 10 drivers (Claude, Gemini, Mistral, Groq, DeepSeek, Grok, Kimi, LMStudio, GenericLLM, Ollama). The wrong key MaxTokens was never resolved by RTTI to the Max_tokens property, causing Max_Tokens to be silently ignored when set via RegisterDefaultParams.
  • ApplyParamsToChat — locale-independent float parsingTryStrToFloat now tries invariant format (dot decimal) first, then falls back to the system locale. Both Temperature=0.7 and Temperature=0,7 are valid regardless of regional settings.

Bug Fixes (March 2026)

  • MCP concurrent tool calls — race condition (uMakerAi.MCPClient.Core.pas): When a model responded with two or more tools from the same MCP server in a single turn, ParseChat launched all tool calls as parallel TTasks. Since TMCPClientStdIo shares a single process/pipe per instance (no synchronization), concurrent calls corrupted the JSON-RPC communication, causing intermittent failures. Fixed by adding FCallLock: TCriticalSection to TMCPClientCustom — calls to the same server are now serialized while calls to different servers still run in parallel.

  • EAggregateException on tool errors — Claude driver (uMakerAi.Chat.Claude.pas): The local _CreateTask procedure in TAiClaudeChat.ParseChat lacked the try/except present in the base class. Any exception raised inside a tool task (MCP timeout, network error, etc.) escaped unhandled, causing TTask.WaitForAll to wrap it in an EAggregateException and crash the application. Fixed to match base class behavior: exceptions are caught, reported via OnError, and the tool receives an error response so the conversation can continue.


🏗️ Architecture

┌──────────────────────────────────────────────────────────────────┐
│  Your Delphi Application                                         │
└────┬──────────────────┬─────────────────┬────────────────────────┘
     │                  │                 │
┌────▼────┐   ┌─────────▼──────────┐  ┌──▼────────────────────────┐
│ ChatUI  │   │ Agents             │  │ Design-Time               │
│ FMX     │   │ TAIAgentManager    │  │ Property Editors          │
│ Visual  │   │ TAIBlackboard      │  │ Object Inspector support  │
│ Comps   │   │ Checkpoint/Approve │  └───────────────────────────┘
└────┬────┘   └─────────┬──────────┘
     │                  │
┌────▼──────────────────▼──────────────────────────────────────────┐
│  TAiChatConnection  — Universal Connector                        │
│  Switch provider at runtime via DriverName property             │
└──────────────────────────────┬───────────────────────────────────┘
                               │
┌──────────────────────────────▼───────────────────────────────────┐
│  Native Provider Drivers  (direct API access, full fidelity)     │
│  OpenAI · Claude · Gemini · Grok · Mistral · DeepSeek · Kimi    │
│  Groq · Cohere · Ollama · LM Studio · GenericLLM                │
└──────────────────────────────┬───────────────────────────────────┘
                               │
     ┌─────────────────────────┼────────────────────────┐
     │                         │                        │
┌────▼────────┐   ┌────────────▼────────┐   ┌───────────▼─────────┐
│  ChatTools  │   │  RAG                │   │  MCP                │
│  PDF/Vision │   │  Vector (VQL)       │   │  Server (HTTP/SSE   │
│  Speech/STT │   │  Graph (GQL)        │   │  StdIO/Direct)      │
│  Web Search │   │  PostgreSQL/SQLite  │   │  Client             │
│  Shell      │   │  HNSW · BM25 · RRF  │   │  TAiFunctions bridge│
│  ComputerUse│   │  Rerank · Documents │   └─────────────────────┘
└─────────────┘   └─────────────────────┘

┌──────────────────────────────────────────────────────────────────┐
│  Realtime Voice — parallel WebSocket stack                       │
│  TAiRealtimeConnection · OpenAI STT · Grok Voice S2S · MakerAI   │
│  Pure-Pascal RFC 6455 + TLS (SChannel / OpenSSL / Android)       │
└──────────────────────────────────────────────────────────────────┘

📡 Supported AI Providers

MakerAI gives you two ways to work with each provider, which you can mix freely:

Direct Provider Components

Full, provider-specific access to every API feature. Use when you need complete control:

Component Provider Latest Models
TAiOpenChat OpenAI gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-image-1
TAiClaudeChat Anthropic claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5
TAiGeminiChat Google gemini-3.1-pro, gemini-3-flash, gemini-3.1-flash-lite
TAiGrokChat xAI grok-4-fast, grok-3, grok-code-fast-1
TAiMistralChat Mistral AI magistral-medium, devstral, voxtral
TAiDeepSeekChat DeepSeek deepseek-reasoner, deepseek-chat
TAiKimiChat Moonshot kimi-k2, kimi-k2.5, kimi-k2-thinking
TAiGroqChat Groq llama-4-scout, llama-4-maverick, kimi-k2, qwen3
TCohereChat Cohere command-a-03-2025, command-a-reasoning, command-a-vision
TAiOllamaChat Ollama Any local model
TAiLMStudioChat LM Studio Any local model
TAiGenericChat OpenAI-compatible Any OpenAI-API endpoint

Universal Connector

Provider-agnostic code. Switch models or providers by changing one property:

AiConn.DriverName := 'OpenAI';
AiConn.Model := 'gpt-5.2';
AiConn.ApiKey := '@OPENAI_API_KEY';  // resolved from environment variable

// Switch to Gemini without changing anything else
AiConn.DriverName := 'Gemini';
AiConn.Model := 'gemini-3.0-flash';
AiConn.ApiKey := '@GEMINI_API_KEY';

📊 Feature Support Matrix

Feature OpenAI (gpt-5.2) Claude (4.6) Gemini (3.0) Grok (4) Mistral DeepSeek Ollama
Text Generation
Streaming (SSE)
Function Calling
JSON Mode / Schema
Image Input
PDF / Files ⚠️ ⚠️
Image Generation
Video Generation
Extended Thinking ⚠️
Speech (TTS/STT) ⚠️
Realtime Voice (WebSocket) ✅ STT ⚠️ ✅ S2S
Web Search
Computer Use
RAG (all modes)
MCP Client/Server
Agents

Legend: ✅ Native | ⚠️ Tool-Assisted bridge | ❌ Not Supported


🧩 Ecosystem Modules

🧠 RAG — Retrieval-Augmented Generation

Two complementary retrieval engines with their own query languages:

Vector RAG — semantic and hybrid search over document embeddings:

  • HNSW index for approximate nearest-neighbor search
  • BM25 lexical index for keyword matching
  • Hybrid search with RRF (Reciprocal Rank Fusion) or weighted fusion
  • Reranking and Lost-in-the-Middle reordering for LLM context
  • VQL (Vector Query Language) — SQL-like DSL for complex retrieval queries:
    MATCH documents SEARCH 'machine learning'
    USING HYBRID WEIGHTS(semantic: 0.7, lexical: 0.3) FUSION RRF
    WHERE category = 'tech' AND date > '2025-01-01'
    RERANK 'neural networks' WITH REGENERATE
    LIMIT 10
    
  • Drivers: PostgreSQL/pgvector, SQLite, in-memory

Graph RAG — knowledge graph with semantic search over entities and relationships:

  • Nodes and edges with embeddings and metadata
  • MakerGQL — Graph Query Language based on ISO/IEC 39075:2024 (GQL standard):
    MATCH (p:Person)-[r:WORKS_AT]->(c:Company)
    WHERE c.city = 'Madrid' DEPTH 2
    RETURN p, r, c
    
  • Dijkstra shortest path, centrality analysis, hub detection
  • Export to GraphViz DOT, GraphML (Gephi), native JSON format
  • Document lifecycle management (ingest → chunk → embed → link)

🤖 Agents — Autonomous Orchestration

Graph-based multi-agent workflows with full thread safety:

  • TAIAgentManager — executes directed graphs of AI nodes via thread pool
  • TAIAgentsNode — single execution unit; runs an LLM call, a tool, or custom logic
  • TAIBlackboard — thread-safe shared state dictionary between all nodes
  • Link modes: lmFanout (parallel broadcast), lmConditional (routing), lmExpression (binding), lmManual
  • Join modes: jmAny (first arrival wins), jmAll (wait for all inputs)
  • Durable execution: IAiCheckpointer persists full agent state between process restarts; built-in implementations: TAiFileCheckpointer (JSON files) and TAiDatabaseCheckpointer (FireDAC — SQLite, PostgreSQL, Firebird, etc.)
  • Human-in-the-loop: Node.Suspend(Reason, Context) pauses a node and saves the checkpoint; TAiWaitApprovalTool provides a drop-in approval tool; resume with ResumeThread(ThreadID, NextNode, HumanInput)
  • Supports any LLM provider via TAiChatConnection

🔗 MCP — Model Context Protocol

Full dual-era implementation of the MCP standard for both consuming and exposing tools: supports the stateless spec revision 2026-07-28 (per-request _meta, server/discover, MRTR elicitation) and interoperates automatically with legacy peers that still use the initialize handshake.

MCP Server — expose Delphi functions as MCP tools, callable by any MCP client (Claude Desktop, AI agents, etc.):

  • Transports: HTTP (Streamable HTTP — stateless per spec 2026-07-28), StdIO, Direct (in-process), SSE (legacy — see deprecation note below)
  • Dual-era per request: modern clients are served stateless (per-request _meta identity + OnClientConnect vetting); legacy clients keep the initialize handshake and Mcp-Session-Id session gating
  • MRTR (Multi Round-Trip Requests): tools can pause and ask the user for confirmation or data via elicitation (resultType: "input_required" + opaque requestState) — working example in Demos/031-MCPServer/uTool.ConfirmDemo.pas
  • Bridge TAiFunctions → IAiMCPTool — any existing TAiFunctions component becomes an MCP server instantly
  • API Key authentication, CORS configuration
  • TAiMCPResponseBuilder for structured responses (text + files + media)
  • RTTI-based automatic JSON Schema generation from parameter classes

MCP Client — consume any external MCP server from your Delphi app:

  • Dual-era probe: tries server/discover first and falls back to the legacy handshake automatically; the negotiated mode is exposed in NegotiatedProtocol
  • OnInputRequired event resolves MRTR elicitations (retry loop with requestState echo; assigning the handler declares the elicitation capability)
  • Connect to Claude Desktop tools, filesystem servers, database tools, etc.
  • Integrated into TAiFunctions component alongside native function definitions

⚠️ SSE transport deprecation (spec 2026-07-28): the classic HTTP+SSE transport (GET /sse + POST /messages) was formally moved to Deprecated state by MCP spec revision 2026-07-28 under the project's feature-lifecycle policy, which mandates a minimum 12-month window. Its earliest possible removal from the spec is July 2027 — actual removal happens in the first spec revision published after that date, at the maintainers' discretion, and may come later. Removal deletes the transport from future spec revisions only: existing MakerAI SSE endpoints keep working between themselves, but third-party clients (Claude Desktop, official SDKs) will progressively drop it. Use the HTTP or StdIO transports for anything new. Note that SSE as a streaming response format survives inside Streamable HTTP — only the standalone HTTP+SSE transport is being retired.

🛠️ ChatTools — AI × Deterministic Capabilities

ChatTools bridge the gap between AI reasoning and real-world operations. They activate automatically based on gap analysis between SessionCaps and ModelCaps:

Tool Interface What it does Implementations
IAiPdfTool Extract text from PDFs Mistral OCR, Ollama OCR
IAiVisionTool Describe / analyze images Any vision model
IAiSpeechTool Text-to-speech / speech-to-text Whisper, Gemini Speech, OpenAI TTS
IAiWebSearchTool Live web search Gemini Web Search
IAiImageTool Generate images DALL-E 3, gpt-image-1, Gemini, Grok
IAiVideoTool Generate video Sora, Gemini Veo
TAiShell Execute shell commands Windows/Linux
TAiTextEditorTool Read/write/patch files Diff-based editing
TAiComputerUseTool Control mouse and keyboard Claude Computer Use, OpenAI

Tools follow a common pattern: SetContext(AiChat) + Execute*(). They can run standalone, as function-call bridges, or as automatic capability bridges.

🎙️ Realtime Voice — WebSocket STT & Speech-to-Speech

A parallel component stack for live audio over WebSocket, with the same universal-connector pattern as chat (TAiRealtimeConnection.DriverName):

Driver Type Endpoint
TAiOpenAiRealtimeSTT STT only — streaming transcription (gpt-live-transcribe default) OpenAI Realtime API
TAiGrokRealtimeChat Full-duplex speech-to-speech — the user talks, Grok answers with voice xAI wss://api.x.ai/v1/realtime
TAiMakerAiRealtimeChat STT + LLM + TTS in one socket MakerAI server
TAiGeminiRealtimeSTT STT (planned) Gemini Live
  • TAiRealtimeVoiceBase — shared base for full-duplex drivers: OnAssistantText[Delta], OnAudioChunk, OnAudioDone, on top of the STT events (OnTranscriptDelta/Completed, OnSpeechStarted/Stopped)
  • Voice function calling (Grok): plug a TAiFunctions component and the model invokes your Delphi functions mid-conversation
  • Session resumption, binary audio transport, ephemeral tokens for mobile/browser clients (Grok)
  • Audio pipeline: TAIVoiceMonitor (mic) → thread-safe PCM16 resampler → provider rate (24 kHz); push audio from any source via SendAudioChunk
  • Pure-Pascal WebSocket stack (TAiWSClient, RFC 6455) with pluggable TLS: Windows SChannel (zero DLLs), OpenSSL (Linux/macOS), javax.net.ssl (Android)

⚙️ Model Capabilities — TAiCapabilities

Introduced in v3.3 and refined in v3.4, the TAiCapabilities system replaces all manual feature flags with two declarative sets:

  • ModelCaps — what the model natively supports (e.g., [cap_Image, cap_Reasoning])
  • SessionCaps — what the session needs
  • Gap = SessionCaps − ModelCaps — any missing capability activates an automatic ChatTool bridge; for example, a text-only model with cap_GenImage in SessionCaps automatically routes image generation requests through a DALL-E or Gemini bridge
// Default capabilities for all models of a provider
TAiChatFactory.Instance.RegisterUserParam('MyProvider', 'ModelCaps',   '[cap_Image, cap_Pdf]');
TAiChatFactory.Instance.RegisterUserParam('MyProvider', 'SessionCaps', '[cap_Image, cap_Pdf, cap_GenImage]');

// Per-model override (e.g., a reasoning model)
TAiChatFactory.Instance.RegisterUserParam('MyProvider', 'my-model', 'ModelCaps',    '[cap_Image, cap_Reasoning]');
TAiChatFactory.Instance.RegisterUserParam('MyProvider', 'my-model', 'ThinkingLevel', 'tlMedium');

Available capabilities: cap_Image, cap_Audio, cap_Video, cap_Pdf, cap_Reasoning, cap_WebSearch, cap_GenImage, cap_GenVideo, cap_TTS, cap_STT, cap_ComputerUse

ThinkingLevel controls reasoning depth: tlLow, tlMedium, tlHigh.

🎨 FMX Visual Components

Two generations of FireMonkey components for building multimodal chat UIs:

Next-generation (v3.4) — Skia-native, virtualized, zero FMX child controls:

  • TAIChatView — single-canvas virtualized conversation renderer; only visible messages are painted; supports multi-message text selection, dark/light theme, context menu, long-press (mobile), copy-button feedback with timer, and a scrollbar that doesn't interfere with content
  • TAIChatInput — fully Skia-painted input bar with custom dropdown overlay (no TPopupMenu required), voice-mode indicator, file attachment chips, and TAIVoiceMonitor integration; layout adapts from 1 to N attachment chips automatically

Classic components — FMX-layout-based, simpler to subclass:

  • TChatList — scrollable message container with Markdown rendering, code blocks, copy buttons
  • TChatBubble — individual message bubble (user / assistant / tool)
  • TChatInput — text input bar with voice recording, file attachment, and send button

Both sets are compatible with all providers and work with streaming responses.

📐 Design-Time Integration

Full Delphi IDE support via the MakerAiDsg.dpk design-time package:

  • DriverName property shows a dropdown of all registered providers in the Object Inspector
  • Model property lists all models for the selected provider
  • MCP Client configuration editor with transport type selection
  • Embedding connection editor
  • Version/About dialog

📦 Installation

git clone https://github.com/gustavoeenriquez/MakerAi.git

Step 1 — Add Library Paths

Before compiling any package, add all of these to Tools > Options > Language > Delphi > Library:

Source/Agents
Source/Chat
Source/ChatUI
Source/Core
Source/Design
Source/Embeddings
Source/MCPClient
Source/MCPServer
Source/Packages
Source/RAG
Source/Realtime
Source/Resources
Source/Tools
Source/Utils
Source/WebSocket

Step 2 — Compile and Install Packages

Compile and install in this exact order:

  1. Source/Packages/MakerAI.dpk — Runtime core (~100 units)
  2. Source/Packages/MakerAi.RAG.Drivers.dpk — PostgreSQL/pgvector connector
  3. Source/Packages/MakerAi.UI.dpk — FMX visual components
  4. Source/Packages/MakerAiDsg.dpk — Design-time editors (requires VCL + DesignIDE)

Open Source/Packages/MakerAiGrp.groupproj to compile all packages at once.

API Keys

API keys are resolved from environment variables using the @VAR_NAME convention:

AiConn.ApiKey := '@OPENAI_API_KEY';    // reads OPENAI_API_KEY from environment
AiConn.ApiKey := '@CLAUDE_API_KEY';    // reads CLAUDE_API_KEY
AiConn.ApiKey := '@GEMINI_API_KEY';    // reads GEMINI_API_KEY
AiConn.ApiKey := '@GROK_API_KEY';      // reads GROK_API_KEY (xAI chat and Grok Voice)
AiConn.ApiKey := 'sk-...';             // or set a literal key directly

Delphi Version Compatibility

Delphi Version Support
10.4 Sydney Limited (minimum supported)
11 Alexandria Full support
12 Athens Full support
13 Florence Full support
13.1 Florence Full support (latest tested)

🗂️ Demo Projects

Open Demos/DemosVersion31.groupproj to access all demos.

Demo Description
010-Minimalchat Minimal chat with Ollama and TAiChatConnection
012-ChatAllFunctions Full-featured multimodal chat (images, audio, streaming, tools)
012-ChatWebList Chat with web-based content list
021-RAG+Postgres-UpdateDB Build a vector RAG database with PostgreSQL/pgvector
022-1-RAG_SQLite Lightweight vector RAG with SQLite
023-RAGVQL VQL query language for semantic search
025-RAGGraph Knowledge graph RAG with GQL queries
026-RAGGraph-Basic Simplified graph RAG patterns
027-DocumentManager Document ingestion and management
031-MCPServer Multi-protocol MCP server (HTTP, SSE, StdIO)
032-MCP_StdIO_FileManager File manager exposed via MCP StdIO
032-MCPServerDataSnap MCP server using DataSnap transport
034-MCPServer_Http_FileManager File manager via MCP HTTP
035-MCPServerWithTAiFunctions TAiFunctions bridge to MCP
036-MCPServerStdIO_AiFunction StdIO MCP server with AI functions
041-GeminiVeo Video generation with Google Veo
051-AgentDemo Visual agent graph builder and runner
052-AgentConsole Console-based agent execution (conditional and parallel flows)
053-DemoAgentesTools Agents with integrated tool use
054-AgentCheckpointDB Durable agent execution: suspend/resume with TAiDatabaseCheckpointer (SQLite via FireDAC)
060-AIChatUI Next-generation TAIChatView + TAIChatInput components — full multimodal demo
072-A2AFederation Agent federation over the A2A 1.0 protocol: expose a graph as an A2A agent, consume it, and delegate a local node to a remote agent (no LLM required; --otel for tracing)

🔄 Changelog

v3.6.0 (2026-08-02)

  • New: Regression suite — Tests/RegressionSuite/ — the framework finally has an automated safety net: 17 cases covering MCP dual-era + MRTR, agent graphs, A2A 1.0 + federation, guardrails and the evals runner itself. Fully in-process (spins up its own MCP and A2A servers, plus a legacy-only MCP server to exercise the dual-era fallback), no API keys, runs in under a second. Built on TAiEvalRunner, so it doubles as the canonical usage example. --json writes a CI-friendly report; --otel traces every case as an eval.case span
  • New: Guardrails — TAiGuardrails — policy layer that intercepts every tool call before execution (the single choke point in TAiFunctions.DoCallFunction, so it covers local functions, MCP tools and AutoMCP alike). Strict allowlist and blocklist with wildcard masks, forbidden substring patterns in tool arguments, and a programmatic OnCheckToolCall veto; blocked calls never execute and the LLM receives the reason as a JSON error so it can replan. OnBlocked for auditing, BlockedCount for metrics, and a guardrail.blocked span attribute. Assign via TAiFunctions.Guardrails (opt-in, zero impact when unassigned)
  • New: Evals — TAiEvalRunner — lightweight evaluation framework for AI pipelines: fluent test cases (AddCase('x').Input(...).ExpectContains(...).ExpectRegex(...).ExpectMaxLength(...)) run against a generic target function, so the same suite can evaluate a TAiChat, an agent graph, an MCP tool or an A2A agent. Deterministic checks plus optional LLM-as-judge (ExpectJudge('criteria') with a Judge chat). Reports offer ToText for consoles and ToJSON for CI, and each case emits an eval.case OTel span
  • New: A2A protocol (Agent-to-Agent, Linux Foundation) — MVP — first Delphi implementation of the A2A 1.0 spec: TAiA2AServer exposes any TAIAgentManager graph as an A2A agent (Agent Card at /.well-known/agent-card.json, JSON-RPC SendMessage/GetTask/CancelTask with 0.x method aliases; graph suspension maps to TASK_STATE_INPUT_REQUIRED for human-in-the-loop) and TAiA2AClient consumes remote A2A agents (FetchAgentCard, SendText, task lifecycle). No streaming/push yet (declared false per spec, UnsupportedOperationError on streaming calls). OTel spans a2a.client/a2a.server included. Agent federation: TAiA2ARemoteAgentTool lets any graph node delegate its input to a remote A2A agent (assign it as the node's Tool). Runtime-tested e2e (card + SendMessage → COMPLETED + GetTask, plus a local graph federating to a remote A2A graph)
  • New: OpenTelemetry tracing — TAiTelemetry (observability phase 1) — opt-in OTLP/HTTP JSON exporter (standard collector endpoint localhost:4318; works with Jaeger, Grafana Tempo, Langfuse, Arize Phoenix). Spans follow the OpenTelemetry GenAI semantic conventions: chat turns (chat <model> with gen_ai.request.model, gen_ai.system, gen_ai.usage.input/output_tokens, sync and async), tool executions (execute_tool <name>), agent graphs (agent.graph + agent.node <name> nested across pool threads via explicit trace context), RAG retrieval (rag.search with top-K/results/hybrid flags), and MCP client/server requests — with W3C traceparent propagated through MCP _meta (spec 2026-07-28 convention) so client and server processes share one distributed trace. Zero overhead when no TAiTelemetry instance is enabled. Demo 031 gains an --otel flag. Runtime-tested end-to-end (27 spans, cross-process trace propagation, live OpenAI chat span with token usage)
  • New: MCP spec 2026-07-28 (stateless) — dual-era support — the server implements server/discover, per-request _meta (protocol version, client identity, capabilities), resultType + serverInfo on every result, ttlMs/cacheScope cache hints on list results, and the reserved error codes -32020 (HeaderMismatch) / -32022 (UnsupportedProtocolVersion with data.supported). Modern stateless requests bypass the session gate with per-request OnClientConnect vetting; the legacy initialize handshake + Mcp-Session-Id gating remain fully functional
  • New: MCP client dual-era probeTMCPClientStdIo / TMCPClientHttp try server/discover and fall back to the legacy handshake automatically (NegotiatedProtocol exposes the result); modern requests carry _meta plus the MCP-Protocol-Version / Mcp-Method / Mcp-Name headers; the StdIO reader now rescues JSON-RPC embedded in noisy stdout lines
  • New: MRTR (Multi Round-Trip Requests) — tools can request user input via elicitation: the server plumbs params.inputResponses / params.requestState into TAiAuthContext; the client's new OnInputRequired event drives the retry loop (max 3 rounds, opaque requestState echo; assigning the handler declares the elicitation capability). New demo tool confirm_demo in 031-MCPServer
  • Update: MCP spec alignment — deterministic tools/list / resources/list ordering (client caching + LLM prompt-cache friendly); unknown tool/resource now returns -32602 Invalid Params; the 031 demo sends banners to stderr in stdio mode (stdout is protocol-only)
  • Note: the legacy HTTP+SSE transport is formally Deprecated by MCP spec 2026-07-28 (earliest removal from the spec: July 2027, 12-month minimum window); MakerAI keeps it as frozen legacy — prefer HTTP or StdIO for new work

v3.5.0 (2026-08-01)

  • New: Typed ModelConfig channelModelCaps/SessionCaps/Tool_Active/ThinkingLevel moved out of Params/RTTI into a typed surface with per-field user pins (UserFields) and transparent compatibility migration