trading-platform/docs/02-definicion-modulos/OQI-010-llm-trading-integration/especificaciones/ET-LTI-001-architecture.md
Adrian Flores Cortes 8f0235c096 [TASK-2026-02-06-ANALISIS-INTEGRAL-DOCUMENTACION] docs: Complete 6-phase documentation analysis
- FASE-0: Diagnostic audit of 500+ files, 33 findings cataloged (7P0/8P1/12P2/6P3)
- FASE-1: Resolved 7 P0 critical conflicts (ports, paths, dedup OQI-010/ADR-002, orphan schemas)
- FASE-2: Resolved 8 P1 issues (traces, README/CLAUDE.md, DEPENDENCY-GRAPH v2.0, DDL drift, stack versions, DoR/DoD)
- FASE-3: Resolved 12 P2 issues (archived tasks indexed, RNFs created, OQI-010 US/RF/ET, AGENTS v2.0)
- FASE-4: Purged 3 obsolete docs to _archive/, fixed MODELO-NEGOCIO.md broken ref
- FASE-5: Cross-layer validation (DDL→OQI 66%, OQI→BE 72%, BE→FE 78%, Inventories 95%)
- FASE-6: INFORME-FINAL, SA-INDEX (18 subagents), METADATA COMPLETED

27/33 findings resolved (82%), 6 P3 deferred to backlog.
18 new files created, 40+ modified, 4 archived.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:57:03 -06:00

49 lines
1.2 KiB
Markdown

---
id: ET-LTI-001
title: "Arquitectura de Integracion LLM-Trading"
type: "Specification"
status: "Backlog"
rf_parent: "RF-LTI-001"
epic: OQI-010
version: "1.0"
created_date: "2026-02-06"
---
# ET-LTI-001: Arquitectura de Integracion LLM-Trading
## Diagrama
```
LLM Agent (OQI-007)
|
+-- Tool Registry (OQI-010)
| +-- Market Tools -> data-service (port 3084)
| +-- ML Tools -> ml-engine (port 3083)
| +-- Trading Tools -> backend/trading (port 3081)
| +-- Portfolio Tools -> backend/portfolio (port 3081)
|
+-- Prompt Engine (OQI-010)
| +-- Template Selector
| +-- Context Injector
| +-- Safety Filter
|
+-- Guardrails (OQI-010)
+-- Confirmation Handler
+-- Risk Validator
+-- Audit Logger
```
## Flujo de Ejecucion
1. Usuario envia mensaje al LLM
2. LLM selecciona template apropiado basado en intent
3. LLM invoca tools necesarios
4. Safety guardrails validan cada tool call
5. Resultados formateados y retornados al usuario
6. Si es operacion de trading: confirmacion antes de ejecutar
## Tecnologias
- Tool framework: function calling del LLM (Ollama/Claude)
- Backend: Express.js endpoints existentes
- Comunicacion: HTTP entre servicios