# MakerAi **Repository Path**: qinix2/MakerAi ## Basic Information - **Project Name**: MakerAi - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-12 - **Last Updated**: 2026-06-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MakerAI Suite v3.4 β€” The AI Ecosystem for Delphi 🌐 **Official Website:** [https://makerai.cimamaker.com](https://makerai.cimamaker.com) πŸ“– **Manual:** [https://www.gustavoenriquez.com/book-makerai](https://www.gustavoenriquez.com/book-makerai) β€” available in English and Spanish [![GitHub Stars](https://img.shields.io/github/stars/gustavoeenriquez/MakerAi?style=social)](https://github.com/gustavoeenriquez/MakerAi) [![GitHub Issues](https://img.shields.io/github/issues/gustavoeenriquez/MakerAi)](https://github.com/gustavoeenriquez/MakerAi/issues) [![License](https://img.shields.io/github/license/gustavoeenriquez/MakerAi)](LICENSE.txt) [![Telegram](https://img.shields.io/badge/Join-Telegram%20Chat-blue.svg)](https://t.me/+7LaihFwqgsk1ZjQx) [![Delphi Supported Versions](https://img.shields.io/badge/Delphi%20Support-11%20Alexandria%20to%2013%20Florence-blue.svg)](https://www.embarcadero.com/products/delphi) [![Free Pascal](https://img.shields.io/badge/Free%20Pascal-3.2%2B-orange.svg)](https://github.com/gustavoeenriquez/MakerAi/tree/fpc) > **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](https://github.com/gustavoeenriquez/MakerAi/tree/fpc). --- ## 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 - **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.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: ```pascal // 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 ### 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 fix** β€” `FJoinInputs` 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 parsing** β€” `TryStrToFloat` 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 `TTask`s. 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 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## πŸ“‘ 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: ```pascal 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) | βœ… | ❌ | βœ… | ❌ | ❌ | ❌ | ⚠️ | | 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: ```sql 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): ```gql 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 implementation of the MCP standard for both consuming and exposing tools: **MCP Server** β€” expose Delphi functions as MCP tools, callable by any MCP client (Claude Desktop, AI agents, etc.): - Transports: **HTTP**, **SSE** (Server-Sent Events), **StdIO**, **Direct** (in-process) - 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: - Connect to Claude Desktop tools, filesystem servers, database tools, etc. - Integrated into `TAiFunctions` component alongside native function definitions ### πŸ› οΈ 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. ### βš™οΈ 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 ```pascal // 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 ```bash 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: ```pascal 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 := '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 | --- ## πŸ”„ Changelog ### v3.4 (May 2026) - Tested with Delphi 13.1 Florence - Selective driver registration β€” each driver self-registers only when imported - New: **`TAIChatView`** β€” next-generation Skia-native virtualized chat renderer (single canvas, no FMX child controls, multi-message text selection, dark/light theme, mobile long-press) - New: **`TAIChatInput`** β€” fully Skia-painted input bar with custom dropdown overlay, attachment chips, voice indicator (no `TPopupMenu` / no FMX buttons) - New: `TAiRealtimeConnection` + `TAiOpenAiRealtimeSTT` β€” real-time STT via WebSocket (24 kHz PCM16, VAD, streaming transcription; pure-Pascal TLS via Windows SChannel) - New: `cmSmartDispatch` chat mode β€” two-pass intelligent routing - Models: claude-opus-4-7, gpt-5.4/5.5, gemini-3.1-pro, grok-4-fast, kimi-k2, groq llama-4 - Fix: Claude Opus 4.7 Adaptive Thinking β€” HTTP 400 eliminated (temperature/top_p/top_k + thinking block now omitted for claude-opus-4-7) - Fix: AV on async abort β€” nil guard in `TAiChatConnection.OnInternalReceiveDataEnd` - Fix: `TStringStream` leak in async HTTP requests β€” `FCurrentPostStream` lifetime now correctly tied to request completion - Fix: `RegisterDefaultParams` `Max_Tokens` key corrected in 10 drivers - Fix: `ApplyParamsToChat` `TryStrToFloat` now locale-independent - Fix: Agent jmAll join node premature firing on retries - Fix: `TChatBubble` spurious vertical scrollbar eliminated - New: `TChatInput.EnterAsSend` property - New: **`TAiDatabaseCheckpointer`** β€” FireDAC-based checkpoint persistence; works with SQLite, PostgreSQL, Firebird, MySQL, SQL Server, and any other FireDAC driver - Fix: **D11 Alexandria compatibility** β€” `TInterlocked.Exchange(Boolean)` (D12-only) replaced with Integer-based atomic; `AddStream(AShareOwnership)` boundary corrected to `CompilerVersion >= 36`; `THashSet` boundary corrected to `CompilerVersion >= 36` ### v3.3 (February 2026) - New `TAiCapabilities` system (`ModelCaps` / `SessionCaps` / `ThinkingLevel`) - Models updated: OpenAI gpt-5.2, Claude 4.6, Gemini 3.0, Grok 4, Mistral Magistral, DeepSeek-reasoner, Kimi k2.5 - Agents: durable execution (checkpoints), human-in-the-loop approval tool - RAG: Graph Document management (`uMakerAi.RAG.Graph.Documents`) - Fix: `reasoning_content` preserved in multi-turn tool calls (DeepSeek, Kimi, Groq) - New: `TAiEmbeddingsConnection`, `TAiAudioPushStream` - New demos: DocumentManager, ChatWebList ### v3.2 (January 2026) - Native ChatTools framework (`IAiPdfTool`, `IAiVisionTool`, `IAiSpeechTool`, etc.) - Unified deterministic tool orchestration and capability bridges ### v3.1 (November 2025) - GPT-5.1, Gemini 3.0, Claude 4.5 initial support - FMX multimodal UI components - RAG Rerank + Graph RAG engine - MCP Server framework (SSE, StdIO, HTTP) ### v3.0 (October 2025) - Major architecture redesign - Visual FMX chat components - Graph-based vector database - Delphi 10.4–13 compatible (limited: 10.4 Sydney; full support: 11 Alexandria+) ### v2.5 (August 2025) - MCP Client/Server (Model Context Protocol) - Agent graph orchestration - Linux/POSIX full support --- ## πŸ’¬ Community & Support - **Website:** [https://makerai.cimamaker.com](https://makerai.cimamaker.com) - **Manual (EN/ES):** [https://www.gustavoenriquez.com/book-makerai](https://www.gustavoenriquez.com/book-makerai) - **Telegram (Spanish):** [https://t.me/MakerAi_Suite_Delphi](https://t.me/MakerAi_Suite_Delphi) - **Telegram (English):** [https://t.me/MakerAi_Delphi_Suite_English](https://t.me/MakerAi_Delphi_Suite_English) - **Email:** gustavoeenriquez@gmail.com - **GitHub Issues:** [https://github.com/gustavoeenriquez/MakerAi/issues](https://github.com/gustavoeenriquez/MakerAi/issues) --- ## πŸ“œ License MIT License β€” see `LICENSE.txt` for details. Copyright Β© 2024–2026 Gustavo EnrΓ­quez β€” CimaMaker