agentleFS
gustavoeenriquezgustavoeenriquez/MakerAi/Demos/CLAUDE.md

MakerAi / Demos

CLAUDE.md212 starsChanged 2 months agoMITView on GitHub

This is the Demos directory for the MakerAI 3.x framework. Contains 58 working example projects demonstrating AI integration patterns for Delphi developers. La mayoria tiene su propio CLAUDE.md con los detalles de implementacion; los que no, estan marcados abajo. Estado de compilación (ago 7/2026): los 48 proyectos compilan en Win64/Release; el 081 (ago 18/2026), el 082 y el 083 (sep 20/2026) también compilan; el 082 se corrió en runtime (6/6 PASS) y el 083 en Linux64 sobre Xvfb con OpenAI…

  • Reads credentials

The file

Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Overview

This is the Demos directory for the MakerAI 3.x framework. Contains 58 working example projects demonstrating AI integration patterns for Delphi developers. La mayoria tiene su propio CLAUDE.md con los detalles de implementacion; los que no, estan marcados abajo.

Estado de compilación (ago 7/2026): los 48 proyectos compilan en Win64/Release; el 081 (ago 18/2026), el 082 y el 083 (sep 20/2026) también compilan; el 082 se corrió en runtime (6/6 PASS) y el 083 en Linux64 sobre Xvfb con OpenAI y Claude.

Building Demos

IDE: Delphi 11 Alexandria through 13 Florence (demos require Delphi 11+; the core framework supports 10.4 Sydney minimum)

Group project: Open DemosVersion31.groupproj in Delphi IDE to access all demos. El grupo se regeneró en ago 2026; desde sep 29/2026 incluye los 58 proyectos (se sumaron 089-QwenShowcase, que había quedado fuera, y 091-Skills).

OJO al editar los .pas de los demos: varios están en ANSI (Windows-1252) con saltos LF, no en UTF-8. Guardarlos como UTF-8 destruye todas las tildes de forma silenciosa (compila igual, y git diff lo disimula si core.autocrlf está activo). Verificar siempre con git diff --numstat que solo cambien las líneas que se tocaron.

Individual build (MSBuild):

msbuild 010-Minimalchat/MinimalChat.dproj /p:Config=Release /p:Platform=Win64

Build all demos:

msbuild DemosVersion31.groupproj /t:Build /p:Config=Release /p:Platform=Win64

Output: Each project compiles to ./$(Platform)/$(Config)/ (e.g., ./Win64/Release/)

Demo Categories

Chat Integration (01x)

DemoPurposeKey Pattern
010-MinimalchatBasic FMX chatTAiOllamaChat direct + TAiChatConnection factory
012-ChatAllFunctionsFull-featured chatMultimodal (images, audio), streaming, tool calls
014-ChatTestClaude-specific testingClaude API integration

RAG Systems (02x)

DemoPurposeKey Classes
021-RAG+Postgres-UpdateDBVector RAG with PostgreSQLTAiVectorRAG, pgvector
022-1-RAG_SQLiteVector RAG with SQLiteLightweight local storage
023-RAGVQLVector Query LanguageVQL semantic search syntax
025-RAGGraphKnowledge graph RAGTAiGraphRAG, entity relationships
026-RAGGraph-BasicBasic graph RAGSimplified graph patterns
027-DocumentManagerGestor de documentos sobre RAG Graph, 100% localTAiRagDocumentManager + TAiRagGraph con TAiOllamaChat/TAiOllamaEmbeddings; FMX
070-ChatRAGToolsChat multi-proveedor + RAG SQLite + tools, todo en un formularioTAiChatConnection con selector de proveedor/modelo, TAiRAGVector sobre TAiRAGVectorSQLiteDriver (vectorial en Delphi puro, sin vec0) y TAiFunctions con una función que dibuja series en TeeChart

MCP Servers (03x)

DemoPurposeTransport
031-MCPServerMulti-protocol server. Compila tambien en Linux64 desde sep 2026: la herramienta system_info llamaba a la API de Windows desde el cuerpo de sus funciones y tumbaba el demo entero fuera de WindowsSSE, HTTP, StdIO
032-MCP_StdIO_FileManagerFile manager MCPStdIO, HTTP, SSE variants
032-MCPServerDataSnapDataSnap integrationHTTP with DataSnap
035-MCPServerWithTAiFunctionsMCP + function callingTAiFunctions integration
036-MCPServerStdIO_AiFunctionFunction-based MCPStdIO with AI functions
037-MCPServerRAGRAG semántico vía MCP (SSE default)TAiRAGVector + TAiOpenAiEmbeddings, híbrido embeddings+BM25, persistencia rag_index.mkai

Video Generation (04x)

DemoPurposeProvider
041-GeminiVeoVideo generationGoogle Veo API

Agent Orchestration (05x)

DemoPurposeKey Pattern
051-AgentDemoAgent graph workflowsTAIAgentManager, visual orchestration
052-AgentConsoleConsole agent interfaceCommand-line agent execution
054-AgentCheckpointDBDurable execution con checkpoints en base de datosIAiCheckpointer + suspend/resume de grafos
072-A2AFederationFederación de agentes vía protocolo A2A 1.0 (sin LLM)TAiA2AServer expone un grafo (Agent Card + JSON-RPC), TAiA2AClient lo consume, TAiA2ARemoteAgentTool federa un nodo local al agente remoto; --otel para trazas
074-A2AOrchestrationFlujos de orquestación A2A (sin LLM)Pool de managers con OnAcquireManager (3 tasks simultáneos), human-in-the-loop con resume por taskId, HITL federado que suspende el nodo local, y blocking=false + GetTask
079-A2ASutAgentAgente SUT del TCK oficial de A2A: con él se certifica la implementación (MUST 89/89, SHOULD 8/8)Despacha por PREFIJO del messageId (tck-artifact-text, -file-url, tck-input-required…) y es el ejemplo de cómo emitir artifacts estructurados desde un grafo vía blackboard. --port 9999
080-A2APushNotificationsPush notifications A2A: el agente hace POST a tu webhook al terminarAgente (8282) + receptor de webhook propio (8283) en el mismo proceso, sin claves. Cubre lo que el TCK no cubre: la entrega con blocking:false, cuando nadie consulta el task
081-AgentChatHITLHuman-in-the-loop integrado en el chat, sin ventanas modales (sin LLM)Grafo con TAiWaitApprovalTool que suspende sin bloquear threads; OnSuspend publica la pregunta como mensaje del chat y la siguiente respuesta del usuario reanuda con ResumeThread; TAiFileCheckpointer reanuda incluso tras reiniciar la app. Primer demo con la UI nueva TAIChatView/TAIChatInput (Skia)

Guardrails, Evals y Memoria (07x)

DemoPurposeKey Pattern
073-GuardrailsEvalsPolítica de tool calls y evals (sin LLM)TAiGuardrails (allow/blocklist, patrón en argumentos, veto programático) verificando que el tool bloqueado no se ejecuta, + TAiEvalRunner con reporte y exit code
075-MCPElicitationElicitation MCP (MRTR) desde el clienteTMCPClientHttp.OnInputRequired respondiendo accept/decline, y qué se ve si nadie atiende el evento; servidor MCP in-process
076-MemoryMemoria semántica persistenteTAiMemory sobre SQLite/FTS5: Store/Search/Recall/Context/Stats + persistencia. FTS sin API key; híbrido (FTS+semántica con RRF) si hay OPENAI_API_KEY
077-RagPostgresConsoleRAG vectorial sobre PostgreSQL+pgvector, headless y sin API keyTAiRAGVectorPostgresDriver + TAiOllamaEmbeddings: CreateSchema con HNSW, indexado incremental, filtro de metadatos en SQL (JSONB+GIN) e híbrido BM25+RRF. Es el único demo que ejercita el stack RAG sin abrir el IDE
078-RagChatOllamaRAG completo 100% local: recupera de pgvector y responde con TAiOllamaChatCada pregunta se hace con y sin contexto para que se vea la alucinación frente a la respuesta fundamentada. Documenta la trampa de num_predict con modelos de razonamiento (qwen3.5 devolvía vacío)

Decisiones con Jev (08x)

DemoPurposeKey Pattern
084-JevRouterEnrutar consultas a agentes especializados antes de gastar un LLM. Requiere TYPESAFE_API_KEY. Tiene CLAUDE.md propioTAiJev: una llamada con Choice (dominio) + Noul por dominio (consultas cruzadas) + Noul necesita_fuentes (agente con o sin RAG); reglas y catálogo de agentes en código. Bloque C: lo mismo dentro de un grafo con TAiJevRouterTool + lmConditional
085-JevDispatchGuardJev en SmartDispatch y en Guardrails (de herramientas y de entrada). Requiere TYPESAFE_API_KEY. Tiene CLAUDE.md propioTAiJevDispatchClassifier (pase 1 de cmSmartDispatch sin LLM) y TAiJevGuardrailClassifier en TAiGuardrails.Classifier: listas para lo enumerable, Jev para el riesgo que ninguna lista anticipa
088-JevModelRouterEnrutador de modelos: cada petición al modelo más barato que alcanza (Groq → DeepSeek → Claude Sonnet → Opus). Requiere claves de Jev, Groq, DeepSeek y Claude. Tiene CLAUDE.md propioTAiJevModelRouter: reglas de nivel en código, calidad medida con TAiJevEvalScorer (7/8 útiles), migración del historial entre proveedores en una conversación que escala
089-QwenShowcaseQwen (Alibaba Model Studio): chat, visión (generar → editar → describir), voz (TTS, transcripción, omni), traducción qwen-mt, embeddings + rerank y tiempo real (LLM → voz, traducción simultánea con DriverParams); opcionales --video y --voces. Requiere DASHSCOPE_API_KEY. Tiene CLAUDE.md propioTAiQwenChat, TAiQwenEmbeddings, TAiQwenRAGReranker, TAiQwenVoices, TAiQwenRealtimeTTS, TAiRealtimeConnection
087-JevBatchLabelingEtiquetado masivo: 126 movimientos contables contra 225 cuentas del PUC. Requiere TYPESAFE_API_KEY. Tiene CLAUDE.md propioTAiJevBatchLabeler en paralelo: 92.9% total, 100% en lo automatizado (conf ≥ 0.8, 61% de las filas), 4.2 s, US$0.05
086-JevEvalsRagJev en Evals y en RAG. Requiere TYPESAFE_API_KEY. Tiene CLAUDE.md propioTAiJevEvalScorer en TAiEvalRunner.Scorer (ExpectScore) y TAiJevRAGReranker (evidencia por pasaje + descarte de inyecciones)

Skills (09x)

DemoPurposeKey Pattern
091-SkillsSkills en formato SKILL.md (Agent Skills / PPM) de tres formas: bajo demanda en un chat, como base de un nodo de agente y copiados al prompt. Requiere la key del driver (--driver, OpenAI por defecto). Tiene CLAUDE.md propioTAiSkills (use_skill + read_skill_file: el modelo ve el catálogo y carga el skill que necesita), TLLMNode + TAiSkill (ResolveConfig), TAiPrompts.ApplySkill

Audio / Speech (06x)

DemoPurposeKey Pattern
060-ElevenLabsTTSText-to-speechElevenLabs API
061-LoopbackAudioCaptureCapture system playback audio (console)TAiAudioCapture (WASAPI loopback) -> 16 kHz mono WAV
062-BidirectionalTranslatorReal-time bidirectional call translator (console, text output)2x TAiAudioCapture (loopback + mic) -> 2x TAiOpenAiRealtimeSTT -> TAiChatConnection translation. Requires OPENAI_API_KEY. Note: sets Model := 'gpt-realtime' (the driver default gpt-4o-realtime-preview was retired by OpenAI). Transcription uses gpt-live-transcribe (Aug 2026) with TranscriptionPrompt + guided autodetect via Languages (['en','es']).
063-VoiceBridgeTranslatorFull voice bridge: speak Spanish, the meeting hears English TTS (and vice versa)062 pipeline + TAiOpenAiAudio.Speech (trfPcm) + TAiAudioPlayer per side: remote TTS -> default device, own TTS -> VB-CABLE ("CABLE Input"; select "CABLE Output" as mic in the meeting). Uses TAiAudioCapture.Muted as anti-feedback while own TTS plays. Falls back to default device with a warning if no cable found. STT on gpt-live-transcribe (Aug 2026).
064-VoiceBridgeDiarized063 + speaker diarization on the remote channel: each meeting participant gets a stable label and a distinct TTS voiceRemote channel replaces Realtime STT with: local VAD segmenter (level-based, in-demo TSpeechSegmenter) -> Transcribe with tmGpt4oDiarize/trfDiarizedJson -> on-the-fly speaker enrollment (first time a voice appears, its audio is sliced (2-9 s) and registered via AddKnownSpeaker as 'Hablante N' so labels stay consistent across requests; max 4) -> per-speaker translation -> per-speaker TTS voice. Auto-recovers if the API rejects stored speaker samples (clears and re-enrolls). [YO] channel stays on Realtime STT (single speaker, lower latency; gpt-live-transcribe since Aug 2026 — the diarized remote channel stays on gpt-4o-transcribe-diarize because the new models don't support diarization).
065-VoiceBridgeUIEl puente de voz del 063 con interfaz FMX: selección de dispositivos y control en pantallaTAiAudioCapture/TAiAudioPlayer + TAiOpenAiRealtimeSTT + TAiOpenAiAudio sobre TAiChatConnection. Sin CLAUDE.md propio
071-VoiceBridgeTranslateRefactor of 063 using gpt-realtime-translate: one WebSocket per direction replaces the whole STT -> LLM-translate -> TTS pipeline2x TAiAudioCapture -> 2x TAiOpenAiRealtimeTranslate (continuous stream, no VAD/turns) -> TAiAudioPlayer. The server returns translated text (OnAssistantTextDelta) AND translated TTS audio (OnAudioChunk, PCM16 24 kHz) in streaming; SourceTranscription := True also shows what was heard. Lower latency and ~1/3 of the code vs 063; trade-off: the TTS voice is chosen by the server. Same VB-CABLE setup and Muted anti-feedback as 063.

Tests runtime de issues y subsistemas (06x, 08x)

Consolas con asserts automáticos que reproducen un issue concreto contra APIs reales. No son la suite de regresión (esa vive en Tests/RegressionSuite/ y no necesita claves); estos sí requieren API key y sirven para verificar un fix de punta a punta. Solo el 082 y el 083 tienen CLAUDE.md propio.

DemoVerificaRequiere
066-ComputerUseTestComputer Use: 3 proyectos (ComputerUseTest, ComputerUseTest01 y ComputerUseServer, este último con loop manual en formato OpenAI contra el servidor cimamaker). Ver CAPTURA_PANTALLA.mdsegún proyecto
067-PromptCacheTestPrompt caching de Claude: dos requests con el mismo system prompt grande (>1024 tokens) y CacheContext; espera cache_write>0 y luego cache_read>0CLAUDE_API_KEY
068-AsyncHistoryTestIssue #105: en asíncrono Claude debe archivar sus respuestas en el historial. Conversación multi-turno donde el último turno debe recordar los previosCLAUDE_API_KEY
069-McpSessionGateTestIssue #110: vetting de cliente MCP (OnClientConnect) y gate de sesión HTTP por Mcp-Session-Id. Levanta un TAiMCPHttpServer real y lo prueba como cliente en 4 fases— (in-process)
083-ComputerUseLinuxComputer Use en Linux (X11): ciclo agéntico real sobre Xvfb con TAiLinuxExecutor (xdotool + scrot). Es el 066 pero headless y sin tocar el escritorio del usuario. Compila Linux64; en Win64 solo imprime un aviso. Tiene CLAUDE.md propioOPENAI_API_KEY o CLAUDE_API_KEY
082-ComputerUsePassthruQuién ejecuta un computer_call: delegado vía OnCallToolFunction (broker headless), sin ComputerUseTool asignado, y local con ejecutor simulado — los tres en síncrono y en streaming, porque el driver de OpenAI tiene dos implementaciones. Verifica con asserts y exit code; no toca la pantalla (a diferencia del 066). Tiene CLAUDE.md propioOPENAI_API_KEY

Utilities (09x)

DemoPurpose
090-Varios/ListAllModelsList available models across providers
090-Varios/CompareEmbeddingsCompare embedding quality
090-Varios/Dalle_GenerateGeneración de imágenes (hoy gpt-image-1; DALL-E fue retirado)
090-Varios/VoiceMonitorAndWhisperDemoTAiVoiceMonitor + transcripción con Whisper

Common Runtime Dependencies

  • Ollama: Required for local models (default: localhost:11434)
  • API Keys: OpenAI, Claude, Gemini keys in environment or config
  • PostgreSQL + pgvector: For 021-RAG demos
  • SQLite: For 022-RAG demos (included with Delphi)

Navigation Pattern

Each demo subdirectory contains:

  • *.dproj - Delphi project file
  • *.dpr - Program source
  • uMain*.pas / uMain*.fmx - Main form
  • CLAUDE.md - Demo-specific instructions

Common Code Patterns Across Demos

Synchronous AI call:

AiModel.Asynchronous := False;
Response := AiModel.AddMessageAndRun(Prompt, 'user', []);

Streaming with callback:

AiModel.Asynchronous := True;
AiModel.OnReceiveData := procedure(Sender: TObject; Data: string; IsDone: Boolean)
begin
  TThread.Synchronize(nil, procedure begin Memo1.Text := Memo1.Text + Data; end);
end;
AiModel.AddMessageAndRun(Prompt, 'user', []);

Error handling:

AiModel.OnError := procedure(Sender: TObject; ErrorMsg: string; E: Exception; Resp: IHTTPResponse)
begin
  ShowMessage(ErrorMsg);
end;

Navigation

See ../CLAUDE.md for project overview, build instructions, and architecture details.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.