MakerAi
CLAUDE.md212 starsChanged 2 months agoMITView on GitHub
MakerAI is an AI orchestration framework for Delphi developers (v3.8). It provides components for integrating multiple LLM providers (OpenAI, Claude, Gemini, Ollama, Groq, DeepSeek, Kimi, GLM/Z.ai, Qwen/Alibaba, Grok, Mistral, Cohere, LM Studio, GenericLLM), RAG systems (vector and graph-based), MCP servers/clients, A2A agent interoperability, autonomous agents, observability, guardrails and native ChatTools into Delphi applications. Supports Delphi 10.4 Sydney through 13 Florence (limited: 10.4 Sydney; full support: 11 Alexandria+). v3.8 highlights (sep 2026): Jev (TypeSafe AI) para decisiones calibradas sin pasar por…
- Reads credentials
- Sends data out
In this repository6 other files it gives its agents.
- Demos/CLAUDE.mdCLAUDE.md
- Demos-V3_1/CLAUDE.mdCLAUDE.md
- Docs/CLAUDE.mdCLAUDE.md
- Redis/CLAUDE.mdCLAUDE.md
- Resources/CLAUDE.mdCLAUDE.md
- Source/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
No hay pipeline CI/CD configurado.
- Distinctive: line 49
Add these folders to Delphi Library Path (Tools > Options > Language > Delphi > Library):
- Very specific: line 87
Android screen capture: Not implemented (uMakerAi.Utils.ScreenCapture.pas)
- Distinctive: line 88
Whisper streaming mode: Not yet implemented
- Very specific: line 187
Chat State Machine: All chats follow states defined in TAiChatState (acsIdle -> acsConnecting -> acsWriting -> acsToolCalling -> …
- Very specific: line 298
Create Source/Chat/uMakerAi.Chat.[ProviderName].pas inheriting from TAiChat
- Very specific: line 310
Add the unit to MakerAI.dpk package
- Distinctive: line 314
All packages require standard Delphi RTL, RESTComponents, LiveBindings, and Indy.
- Distinctive: line 389
Delete existing BPL files from Delphi's BPL output directory
- Distinctive: line 394
Verify all 16 library paths are added to Delphi Library Path (see Required Library Paths).
- Very specific: line 398
Ensure the environment variable is set system-wide (not just in the current terminal).
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
MakerAI is an AI orchestration framework for Delphi developers (v3.8). It provides components for integrating multiple LLM providers (OpenAI, Claude, Gemini, Ollama, Groq, DeepSeek, Kimi, GLM/Z.ai, Qwen/Alibaba, Grok, Mistral, Cohere, LM Studio, GenericLLM), RAG systems (vector and graph-based), MCP servers/clients, A2A agent interoperability, autonomous agents, observability, guardrails and native ChatTools into Delphi applications. Supports Delphi 10.4 Sydney through 13 Florence (limited: 10.4 Sydney; full support: 11 Alexandria+).
v3.8 highlights (sep 2026): Jev (TypeSafe AI) para decisiones calibradas sin pasar por un LLM (enrutar agentes, SmartDispatch, guardrails de tools y de entrada, evals, rerank RAG con filtro de inyecciones, etiquetado masivo, enrutador de modelos, medición de consumo); driver Qwen (Alibaba) completo; skills en formato SKILL.md (TAiSkills con use_skill bajo demanda para cualquier chat, TAiSkill/TLLMNode arreglados, parser y cliente PPM comunes); Computer Use en Linux. Cambios de comportamiento (6): TLS verificado en POSIX (rompe endpoints autofirmados sin InsecureSkipVerify), IAiMemoryStorage exige el namespace (issue #127, rompe storages propios), Gemini ya ejecuta funciones de usuario, Model vacío usa los parámetros del modelo por defecto TLLMNode.DriverName vacío por defecto y tool_choice forzado solo en la primera llamada (antes loop sin fin). Defaults revisados: Gemini gemini-3.8-flash, OpenAI gpt-6-sol, Claude sigue en claude-haiku-4-5. MAKERAI_BREAKING_CHANGE = True.
v3.7 highlights (sep 2026): refresco de Computer Use en los dos proveedores vivos — Claude estaba roto (computer_20251124 ya lo rechaza el API; ahora computer_toolset_20260801, sin parametros y con 17 herramientas nombradas) y OpenAI estrena el tool nativo computer con gpt-6-astra, que manda un lote de acciones por turno; ambos APIs convergieron en no declarar dimensiones y devolver coordenadas en pixeles del screenshot. Ademas: driver GLM (Zhipu/Z.ai), fixes de RAG sobre pgvector y de contabilidad de tokens/cache.
v3.6 highlights (ago 2026): MCP spec 2026-07-28 stateless dual-era (server/discover + _meta por request, con fallback automático al handshake legacy) y patrón MRTR (elicitation con reintento); observabilidad OpenTelemetry (TAiTelemetry, OTLP/HTTP con GenAI semconv, trazas distribuidas vía traceparent en _meta) instrumentando chat, tools, MCP, agentes y RAG; protocolo A2A 1.0 (TAiA2AServer/TAiA2AClient/TAiA2ARemoteAgentTool — primera implementación Delphi, con federación de grafos); TAiGuardrails (política de tool calls en el choke point de TAiFunctions) y TAiEvalRunner (evals con LLM-as-judge opcional); primera suite de regresión automatizada en Tests/RegressionSuite.
v3.5 highlights (ago 2026): canal tipado ModelConfig (ModelCaps/SessionCaps/Tool_Active/ThinkingLevel fuera de Params/RTTI, con pins por campo y migración de compatibilidad); suite de voz full-duplex (TAiGrokRealtimeChat speech-to-speech, TAiOpenAiRealtimeTranslate, gpt-transcribe); refresh completo de los 9 providers cloud probado runtime (Claude 5 adaptive, Gemini 3.5/3.6, Voxtral TTS, Kimi K3, DeepSeek V4, Cohere A+, Groq qwen3.6, xAI grok-4.3/4.5); generación de video nativa Grok; LastError poblado en todos los paths de error; driver MSSQL para RAG Vector.
v3.4 highlights: registro selectivo de drivers restaurado — TAiChatConnection ya no fuerza la carga de todos los providers. Cada driver se auto-registra solo cuando se importa explícitamente. Para cargar todos los drivers de una vez, agregar uMakerAi.Chat.Initializations al uses.
v3.3 highlights: nuevo sistema de orquestación TAiCapabilities (ModelCaps/SessionCaps) que unifica y simplifica la configuración de capacidades por modelo; soporte de modelos actualizado para todos los providers (Feb 2026).
Official Website: https://makerai.cimamaker.com
Language note: Code comments, variable names, and some documentation are in Spanish. When writing new code or comments, follow the existing style of the file being edited (Spanish if the file uses Spanish, English otherwise).
Git workflow: master is the main/release branch. dev is the active development branch. PRs target master.
Testing: Tests/RegressionSuite/ es la suite de regresión del framework (101 casos, in-process, sin API keys, ~5 s). Construida sobre TAiEvalRunner; cubre MCP dual-era + MRTR, agentes, A2A 1.0 + federación, guardrails, serialización de tool results y el propio runner de evals. Ejecutar antes de cada release:
msbuild Tests/RegressionSuite/MakerAiRegressionSuite.dproj /p:Config=Release /p:Platform=Win64
Tests/RegressionSuite/Win64/Release/MakerAiRegressionSuite.exe # exit 0 = verde
Tests/RegressionSuite/Win64/Release/MakerAiRegressionSuite.exe --json report.json # para CINo hay pipeline CI/CD configurado. Los subsistemas visuales y los proveedores LLM reales se siguen verificando manualmente con los 19+ demos de Demos/.
Building and Installation
Package Compilation Order
Compile and install packages in this exact order:
Source/Packages/MakerAI.dpk- Runtime core (~98 units)Source/Packages/MakerAi.RAG.Drivers.dpk- Database connectors (PostgreSQL)Source/Packages/MakerAi.UI.dpk- FMX visual componentsSource/Packages/MakerAiDsg.dpk- Design-time editors (requires VCL, DesignIDE)
Group project: Source/Packages/MakerAiGrp.groupproj
Required Library Paths
Add these folders to Delphi Library Path (Tools > Options > Language > Delphi > Library):
Source/AgentsSource/ChatSource/ChatUISource/CoreSource/DesignSource/EmbeddingsSource/MCPClientSource/MCPServerSource/MemorySource/PackagesSource/RAGSource/RealtimeSource/ResourcesSource/ToolsSource/UtilsSource/WebSocket
Running Demos
Open Demos/DemosVersion31.groupproj in Delphi IDE to access all demo projects.
Testing MCP Servers
# Run demo server
AiMCPServerDemo.exe --protocol sse --port 8080
# Test via curl
curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'Known Issues
- MCP SSE Server is experimental (intermittent connectivity)
- Linux compilation requires manual path adjustments
- macOS support is incomplete (
MAKERAI_SUPPORT_MACOS = Falsein version.inc)
Incomplete Features (code TODOs)
- Android screen capture: Not implemented (
uMakerAi.Utils.ScreenCapture.pas) - Whisper streaming mode: Not yet implemented
- Async transcription: OpenAI async transcription mode pending
- OpenAI Audio streaming events:
speech.audio.deltaandtranscript.text.deltaparsing not implemented - Mistral OCR annotations: Feature stub present but unimplemented
- Claude Citations (RAG nativo): Implementación parcial disponible; soporte completo pendiente
- Gemini Speech cost estimation: Token/cost tracking not yet implemented
- Gemini Realtime STT:
uMakerAi.Realtime.Gemini.pas— stub implementado, conexión y envío de audio pendientes
Architecture
Overview Diagram
┌─────────────────────────────────────────────────────────────┐
│ Application / Demos │
└──────┬──────────────────┬──────────────────┬────────────────┘
│ │ │
┌──────v──────┐ ┌────────v────────┐ ┌──────v──────────────┐
│ ChatUI │ │ Agents │ │ Design-Time (Dsg) │
│ TChatList │ │ TAIAgentManager│ │ Property editors │
│ TChatInput │ │ TAIBlackboard │ │ VCL + DesignIDE │
└──────┬──────┘ └────────┬────────┘ └──────┬──────────────┘
│ │ │
┌──────v──────────────────v──────────────────v────────────────┐
│ Chat Drivers │
│ OpenAI│Claude│Gemini│Ollama│Groq│Mistral│DeepSeek│Kimi│...│
│ TAiChatConnection (universal connector via DriverName) │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────v──────────────────────────────────┐
│ Core Layer │
│ TAiChat (abstract) │ TAiMediaFile │ TAiChatMessages │
└──────┬───────────────────┬──────────────────┬───────────────┘
│ │ │
┌──────v──────┐ ┌─────────v────────┐ ┌──────v──────────────┐
│ Tools │ │ RAG │ │ MCP │
│ Functions │ │ Vectors + Graph │ │ Client + Server │
│ Shell │ │ VQL + GQL │ │ StdIO/HTTP/SSE │
└─────────────┘ └──────────────────┘ └─────────────────────┘Core Layers
Core (Source/Core/): Foundation classes
uMakerAi.Core.pas- Base types:TAiMediaFile,TAiFileCategory,TAiChatMediaSupport,TAiCapability,TAiCapabilities, chat statesuMakerAi.Chat.pas- AbstractTAiChatbase class; incluyeModelCaps,SessionCaps,EnsureNewSystemConfig; orquestador internoRunNew(privado — no llamar directamente; usarAddMessageAndRunoRun)uMakerAi.Chat.Messages.pas- Message handling (TAiChatMessage,TAiChatMessages)uMakerAi.Embeddings.pas- Embedding generation
Chat Drivers (Source/Chat/): LLM-specific implementations
uMakerAi.Chat.AiConnection.pas-TAiChatConnectionuniversal connector (switch providers viaDriverNameproperty)- Provider-specific drivers:
TAiOpenChat,TAiClaudeChat,TAiGeminiChat,TAiOllamaChat,TAiGroqChat,TAiDeepSeekChat,TAiKimiChat,TAiGrokChat,TAiMistralChat,TCohereChat,TAiLMStudioChat,TAiGenericChat uMakerAi.Chat.Initializations.pas- Driver registration and default model parameters viaTAiChatFactory
Agents (Source/Agents/): Autonomous agent framework
uMakerAi.Agents.pas- Graph-based agent orchestration withTAIAgentManager,TAIAgentsNode,TAIAgentsLinkTAIBlackboard- Shared state between agent nodes- Link modes:
lmFanout,lmConditional,lmManual,lmExpression
RAG (Source/RAG/): Retrieval-Augmented Generation
uMakerAi.RAG.Vectors.pas- Vector-based RAG with rerankinguMakerAi.RAG.Graph.Core.pas- Knowledge graph RAG engineuMakerAi.RAG.Graph.GQL.pas- Graph query languageuMakerAi.RAG.Vectors.VQL.pas- Vector query language
MCP (Source/MCPClient/, Source/MCPServer/): Model Context Protocol
uMakerAi.MCPClient.Core.pas- MCP client for consuming external servers- Server implementations: StdIO, HTTP, SSE, Direct
Tools (Source/Tools/): Capabilities framework
uMakerAi.Tools.Functions.pas- Function calling system (TAiFunctions,TAiToolsFunction)- Provider tools: Whisper (STT), DALL-E, Sora (video), Veo (video via Gemini)
- Agent tools:
TAiShell,TAiTextEditorTool,TAiComputerUseTool - Tool interfaces:
IAiPdfTool,IAiVisionTool,IAiSpeechTool,IAiWebSearchTool
WebSocket (Source/WebSocket/): Standalone RFC 6455 WebSocket client (used by Realtime module)
uMakerAi.WebSocket.Client.pas-TAiWSClient— pure-Pascal RFC 6455 + HTTP Upgrade + reader thread; usesITlsTransportinterfaceuMakerAi.WebSocket.SChannel.pas-TSChannelTransport— TLS viasecur32.dll(Windows native, zero extra DLLs; tested ✅)uMakerAi.WebSocket.OpenSSL.pas-TOpenSSLTransport— TLS viadlopen(libssl.so)(Linux/macOS; compiles, not yet tested on real hardware)uMakerAi.WebSocket.Android.pas-TAndroidSSLTransport— TLS viajavax.net.ssl.SSLSocketFactory(JNI; compiles, not yet tested on real hardware)
Realtime (Source/Realtime/): Real-time audio streaming (STT via WebSocket)
uMakerAi.Realtime.pas- Abstract baseTAiRealtimeBase+TAiRealtimeFactory; resampler PCM16, VAD modes, thread-safe eventsuMakerAi.Realtime.AiConnection.pas-TAiRealtimeConnectionuniversal connector (same pattern asTAiChatConnection)uMakerAi.Realtime.OpenAI.pas-TAiOpenAiRealtimeSTT— WebSocket towss://api.openai.com/v1/realtime, 24 kHz PCM16; full implementationuMakerAi.Realtime.Gemini.pas-TAiGeminiRealtimeSTT— 16 kHz PCM16; stub, pendiente implementaciónuMakerAi.Realtime.Grok.pas-TAiGrokRealtimeChat— xAI Grok Voice speech-to-speech,wss://api.x.ai/v1/realtime, protocolo compatible OpenAI Realtime, 24 kHz PCM16; implementado, pendiente prueba runtimeuMakerAi.Realtime.WebSocket.pas- compatibility shim; re-exportsTAiRealtimeWSClient→TAiWSClient(Source/WebSocket/)
ChatUI (Source/ChatUI/): FMX visual components
TChatList- Chat container with markdown renderingTChatInput- Text/voice/attachment input bar
Key Design Patterns
Universal Connector Pattern: TAiChatConnection abstracts provider differences. Set DriverName property to switch between providers without code changes.
Media File Abstraction: TAiMediaFile handles images, PDFs, audio across all providers. Use TAiFileCategory to identify file types.
Chat State Machine: All chats follow states defined in TAiChatState (acsIdle -> acsConnecting -> acsWriting -> acsToolCalling -> acsReasoning -> acsFinished/acsError). Additional states: acsWaitingForInput for interactive flows.
Driver Registration: Chat drivers register via uMakerAi.Chat.Initializations.pas using TAiChatFactory.Instance.RegisterUserParam(). Custom drivers inherit from TAiChat.
Model Capabilities Configuration (v3.3): Model capabilities are configured per-provider and per-model in uMakerAi.Chat.Initializations.pas usando el nuevo sistema unificado:
ModelCaps(TAiCapabilities) — capacidades nativas del modelo vía completions (e.g.,[cap_Image, cap_Reasoning])SessionCaps(TAiCapabilities) — capacidades deseadas en la sesión; Gap = SessionCaps − ModelCaps activa bridges automáticamenteThinkingLevel— nivel de razonamiento (tlLow,tlMedium,tlHigh)Tool_Active— habilita function calling
API eliminada (no usar en RegisterUserParam): NativeInputFiles, NativeOutputFiles, ChatMediaSupports, EnabledFeatures fueron eliminados de la API pública. Existen internamente en el engine (calculados automáticamente desde ModelCaps/SessionCaps vía SetModelCaps/EnsureNewSystemConfig), pero NO deben usarse directamente.
Agent Graph Execution Model
Agents use a directed graph with nodes (TAIAgentsNode) and links (TAIAgentsLink):
- Link modes:
lmFanout(parallel),lmConditional(if/else),lmManual,lmExpression(binding expressions) - Join modes:
jmAny(first arrival wins),jmAll(wait for all inputs) - Execution status:
esRunning,esCompleted,esError,esTimeout,esAborted - Nodes communicate via
TAIBlackboardshared state dictionary
Key Files Reference
| Task | Primary File |
| Add new LLM provider | Source/Chat/uMakerAi.Chat.*.pas (inherit from TAiChat) |
| Configure model capabilities | Source/Chat/uMakerAi.Chat.Initializations.pas |
| Modify capability orchestration | Source/Core/uMakerAi.Chat.pas (RunNew privado, EnsureNewSystemConfig) |
| Add TAiCapability value | Source/Core/uMakerAi.Core.pas (TAiCapability enum) |
| Modify function calling | Source/Tools/uMakerAi.Tools.Functions.pas |
| RAG vector operations | Source/RAG/uMakerAi.RAG.Vectors.pas |
| RAG graph operations | Source/RAG/uMakerAi.RAG.Graph.Core.pas |
| Agent orchestration | Source/Agents/uMakerAi.Agents.pas |
| MCP server creation | Source/MCPServer/uMakerAi.MCPServer.Core.pas |
| Add Realtime STT provider | Source/Realtime/uMakerAi.Realtime.pas (inherit TAiRealtimeBase) |
| Realtime universal connector | Source/Realtime/uMakerAi.Realtime.AiConnection.pas |
| Version/feature flags | Source/Core/uMakerAi.Version.inc |
Naming Conventions
- Unit prefix:
uMakerAi.(e.g.,uMakerAi.Chat.OpenAi.pas) - Class prefix:
TAiorTAI(e.g.,TAiChat,TAIAgentManager) - Interface prefix:
IAi(e.g.,IAiPdfTool,IAiVisionTool) - Driver naming:
TAi[Provider]Chat(e.g.,TAiOpenChat,TAiClaudeChat,TAiGeminiChat). Exception:TCohereChatdoes not follow this convention.
Delphi Version Compatibility
Compiler Version Reference
| CompilerVersion | Delphi Version | Support Level |
| 34.0 | Delphi 10.4 Sydney | Limited (minimum supported) |
| 35.0 | Delphi 11 Alexandria | Full support |
| 36.0 | Delphi 12 Athens | Full support (primary conditional split) |
| 37.0 | Delphi 13 Florence | Full support (latest tested) |
Key Conditional Split: CompilerVersion 36
The codebase has 79 conditional compilation directives. The primary split is at CompilerVersion 36 (Delphi 12):
- < 35: Uses
uJSONHelper.pasfor missing TJSONObject helper methods - >= 35: Uses native
System.JSONhelpers,TRESTClient.SynchronizeEvents := False - < 35:
TMultipartFormData.AddStreamwithoutAShareOwnershipparameter (Delphi 10.4 only) - >= 35:
TMultipartFormData.AddStreamwithAShareOwnership: Booleanparameter (Delphi 11+) - >= 36:
TThread.ForceQueueavailable (Delphi 12+); useTThread.Queueas fallback for D11
{$IF CompilerVersion >= 34} // Delphi 10.4 Sydney+
Client.SynchronizeEvents := False;
{$IFEND}
{$IF CompilerVersion < 35}
uses uJSONHelper; // JSON helper for older Delphi versions
{$ENDIF}Feature Flags (uMakerAi.Version.inc)
All MAKERAI_HAS_* feature flags are True by default (OpenAI, Whisper, Embeddings, Tool Calling, RAG Vector/Graph, MCP, Chat Connection, UI Components, Agents). Platform flags: Windows, Linux, Mobile are True; macOS is False (incomplete). MAKERAI_API_LEVEL = 38.
Thread Safety Notes
Critical Sections (TCriticalSection)
| Lock | Class | Protects |
FLock | TAiChatMessage | Media file list operations |
FLock | TAIBlackboard | Shared state dictionary |
FJoinLock | TAIAgentsLink | Join counter for multi-input nodes |
FActiveTasksLock | TAIAgentManager | Active task count tracking |
FOutputLock | TAiMCPServerStdio | Stdout writes from multiple threads |
FSessionsLock | TAiMCPServerSSE | SSE session list |
FCS | TAiVoiceMonitor | Audio capture state |
Thread Queuing
TThread.Queue(nil, proc)-- used by all Chat drivers and UI components for non-blocking main-thread updates (40+ call sites)TThread.Synchronize(nil, proc)-- used by Agents (node callbacks) and Gemini live streaming for blocking synchronizationTThreadedQueue<TJSONObject>-- async message buffering in MCP ClientTThreadedQueue<string>-- SSE outbox in MCP Server
Thread Pools
TAIAgentManager.FThreadPool: TThreadPool-- executes agent node callbacks on worker threads- Agent
OnExecutehandlers run on pool threads; useTThread.Synchronizeto access UI
Gemini Live Streaming
TMonitor.Enter/Exit(FPendingScreenshots) protects a shared screenshot list during Gemini's real-time video streaming.
Adding a New LLM Provider
- Create
Source/Chat/uMakerAi.Chat.[ProviderName].pasinheriting fromTAiChat - Implement required abstract methods for API communication
- Register the driver in
uMakerAi.Chat.Initializations.pas:TAiChatFactory.Instance.RegisterUserParam('ProviderName', 'Max_Tokens', '16000'); TAiChatFactory.Instance.RegisterUserParam('ProviderName', 'Tool_Active', 'True'); TAiChatFactory.Instance.RegisterUserParam('ProviderName', 'ModelCaps', '[cap_Image]'); TAiChatFactory.Instance.RegisterUserParam('ProviderName', 'SessionCaps', '[cap_Image]'); // Modelo con reasoning: TAiChatFactory.Instance.RegisterUserParam('ProviderName', 'my-model', 'ModelCaps', '[cap_Image, cap_Reasoning]'); TAiChatFactory.Instance.RegisterUserParam('ProviderName', 'my-model', 'ThinkingLevel', 'tlMedium'); - Add the unit to
MakerAI.dpkpackage
Dependencies
All packages require standard Delphi RTL, RESTComponents, LiveBindings, and Indy. Additional notable dependencies:
- MakerAi.RAG.Drivers.dpk: FireDAC (PostgreSQL database access)
- MakerAi.UI.dpk: FMX (FireMonkey visual framework)
- MakerAiDsg.dpk: VCL +
designide(design-time IDE integration only)
Package Dependency Chain
MakerAI.dpk (standalone - no internal deps)
^
|--- MakerAi.RAG.Drivers.dpk (requires MakerAI + FireDAC)
|--- MakerAi.UI.dpk (requires MakerAI + FMX)
|--- MakerAiDsg.dpk (requires MakerAI + VCL + DesignIDE)Environment Variables
API keys use the @VAR_NAME convention. When a key property starts with @, the framework resolves it via GetEnvironmentVariable() at runtime (handled in TAiChat.ApiKey getter and TParamsRegistry).
Convention: Each provider uses [PROVIDER]_API_KEY (e.g., OPENAI_API_KEY, CLAUDE_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, DEEPSEEK_API_KEY, KIMI_API_KEY, GROK_API_KEY, MISTRAL_API_KEY, COHERE_API_KEY). OLLAMA_API_KEY is usually empty for local setups.
AiConnection.ApiKey := '@OPENAI_API_KEY'; // Resolved via GetEnvironmentVariable
AiConnection.ApiKey := 'sk-...'; // Literal keyError Handling
Custom Exception Classes
| Exception | Module | When Raised |
EVGQLParserError | RAG/VQL | Invalid VQL syntax (lexer/parser errors) |
EVGQLTranslationError | RAG/VQL | VQL-to-SQL compilation failures |
EMCPClientException | MCPClient | MCP transport or protocol errors |
EPythonArchitectureError | Utils | Python architecture mismatch (x86 vs x64) |
Error Patterns
- Chat state machine: Errors transition to
acsErrorstate; handle viaOnStateChangeevent - Agent graph: Invalid graph structure (missing nodes, circular deps) raises
ExceptionduringValidate() - API errors: HTTP errors from providers are caught in
try/exceptand surfaced viaOnErrorevents - Most validation uses
Exception.Create(msg)orException.CreateFmt(msg, [args])-- catch withon E: Exception do
Component Selection Guide
TAiChat vs TAiChatConnection
| Component | Use When | Avoid When |
TAiChatConnection | Provider-agnostic code, switching providers at runtime via DriverName | You need provider-specific API features |
TAi[Provider]Chat | Direct access to provider-specific features, fine-grained control | You want portable/switchable code |
RAG: Vector vs Graph
| Approach | Use When | Avoid When |
TAiRAGVector (Vector RAG) | Document Q&A, similarity search, semantic retrieval | Relationship-heavy data, traversal queries |
RAG Graph (uMakerAi.RAG.Graph.Core) | Knowledge graphs, entity relationships, traversal queries | Simple document similarity search |
MCP Server Transports
| Transport | Use When | Protocol |
| StdIO | IDE integration, Claude Desktop, local tools | stdin/stdout |
| HTTP | REST API integration, request/response pattern | HTTP POST |
| SSE | Streaming responses, real-time updates (experimental) | Server-Sent Events |
| Direct | In-process usage, no IPC overhead | Direct method calls |
Troubleshooting
Package installation fails with BPL version conflict
- Close all Delphi instances
- Delete existing BPL files from Delphi's BPL output directory
- Recompile packages in the correct order (MakerAI -> RAG.Drivers -> UI -> Dsg)
"Unit not found" compilation errors
Verify all 16 library paths are added to Delphi Library Path (see Required Library Paths).
API key not resolving
Ensure the environment variable is set system-wide (not just in the current terminal). The @VAR_NAME syntax requires GetEnvironmentVariable() to find the value at runtime.
JSON parsing errors on older Delphi versions
Delphi < 11 (CompilerVersion < 35) requires uJSONHelper.pas in the uses clause. This is handled automatically via conditional compilation, but verify the unit is accessible in the library path.
MCP SSE Server intermittent connectivity
The SSE transport is experimental. For production use, prefer StdIO or HTTP transport.
External Documentation
Detailed documentation is available in Docs/Version 3/:
| Document | Description |
Manual Instalacion.docx | Installation guide |
uMakerAi-ChatConnection.docx | Complete TAiChatConnection guide with examples |
uMakerAi.Chat.docx | Core chat system reference |
TAiChatClaude-Guia de Uso.docx | Claude provider-specific guide |
TAiChatGemini-Guia de Uso.docx | Gemini provider-specific guide |
uMakerAi-RAG.docx | RAG system documentation |
uMakerAI-RAGGraph.docx | Graph RAG documentation |
uMakerAi.ToolFuncions.docx | Function calling / Tools documentation |
TAiAgentes-FLUENT GRAPH BUILDER.docx | Agent graph builder guide |
uMakerAi-MCP.Server.EN.pdf | MCP Server guide (English) |
uMakerAi-MCP.Server.ES.pdf | MCP Server guide (Spanish) |
uMakerAi-Agents.ES.pdf | Agents documentation (Spanish) |
uMakerAi-RAG.ES.pdf | RAG documentation (Spanish) |
uMakerAi-AudioBridge.md | Audio bridge for real-time call translation: loopback/mic capture, playback to selectable device, VB-CABLE setup & distribution licensing (Spanish) |
uMakerAi-Skills.md / .EN.md | Skills en formato SKILL.md: TAiSkills (bajo demanda con use_skill/read_skill_file), TAiSkill + TLLMNode, TAiPrompts.ApplySkill, registry PPM y seguridad |
Navigation
This project uses a tiered CLAUDE.md system. Each Source/ subdirectory and each demo has its own CLAUDE.md with module-specific guidance. Read the relevant sub-CLAUDE.md before working on a specific module.
Source Modules
| Directory | Documentation |
| Source/ | Top-level source overview |
| Source/Core/ | Foundation classes, TAiChat, TAiMediaFile |
| Source/Chat/ | LLM provider drivers |
| Source/Agents/ | Agent orchestration framework |
| Source/RAG/ | Retrieval-Augmented Generation |
| Source/MCPServer/ | MCP server implementations |
| Source/MCPClient/ | MCP client connector |
| Source/Tools/ | Function calling, Shell, ComputerUse |
| Source/ChatUI/ | FMX visual components |
| Source/Realtime/ | Real-time STT drivers (OpenAI WebSocket, Gemini stub) |
| Source/WebSocket/ | RFC 6455 WebSocket client + TLS transports (SChannel/OpenSSL) |
| Source/Utils/ | Voice monitor, diff updater |
| Source/Design/ | Design-time property editors |
| Source/Resources/ | Embedded resources |
Demos & Docs
| Directory | Documentation |
| Demos/ | Demo projects overview |
| Tests/RegressionSuite/ | Suite de regresión (MCP, agentes, A2A, guardrails, evals) |
| Docs/ | Documentation index |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

