Vapora/migrations/008_rlm_schema.surql
Jesús Pérez df829421d8
Some checks failed
Documentation Lint & Validation / Markdown Linting (push) Has been cancelled
Documentation Lint & Validation / Validate mdBook Configuration (push) Has been cancelled
Documentation Lint & Validation / Content & Structure Validation (push) Has been cancelled
mdBook Build & Deploy / Build mdBook (push) Has been cancelled
Rust CI / Security Audit (push) Has been cancelled
Rust CI / Check + Test + Lint (nightly) (push) Has been cancelled
Rust CI / Check + Test + Lint (stable) (push) Has been cancelled
Documentation Lint & Validation / Lint & Validation Summary (push) Has been cancelled
mdBook Build & Deploy / Documentation Quality Check (push) Has been cancelled
mdBook Build & Deploy / Deploy to GitHub Pages (push) Has been cancelled
mdBook Build & Deploy / Notification (push) Has been cancelled
chore: udate docs, add architecture diagrams
2026-02-16 05:12:22 +00:00

31 lines
1.3 KiB
Plaintext

-- Migration 008: RLM Schema
-- Creates tables for Recursive Language Models (RLM) integration
-- Provides chunking, buffering, and execution history storage
-- Use test namespace and database
USE NS test_rlm_e2e DB test_rlm_e2e;
-- RLM Chunks table (from documents)
-- Note: Using SCHEMALESS instead of SCHEMAFULL because:
-- 1. SurrealDB auto-generates `id` field for all records
-- 2. Explicit `id` field definition in SCHEMAFULL causes conflicts with CREATE queries
-- 3. SCHEMALESS provides flexibility while still allowing indexes
DEFINE TABLE rlm_chunks SCHEMALESS;
-- Indexes for efficient queries (work with SCHEMALESS tables)
DEFINE INDEX idx_rlm_chunks_chunk_id ON TABLE rlm_chunks COLUMNS chunk_id UNIQUE;
DEFINE INDEX idx_rlm_chunks_doc_id ON TABLE rlm_chunks COLUMNS doc_id;
-- RLM Buffers table (pass-by-reference for large contexts)
DEFINE TABLE rlm_buffers SCHEMALESS;
-- Indexes for buffers
DEFINE INDEX idx_rlm_buffers_buffer_id ON TABLE rlm_buffers COLUMNS buffer_id UNIQUE;
-- RLM Execution History table (for learning)
DEFINE TABLE rlm_executions SCHEMALESS;
-- Indexes for execution history
DEFINE INDEX idx_rlm_executions_execution_id ON TABLE rlm_executions COLUMNS execution_id UNIQUE;
DEFINE INDEX idx_rlm_executions_doc_id ON TABLE rlm_executions COLUMNS doc_id;