Turn PostgreSQL into a self-compiling knowledge base. Insert documents; an LLM compiles them into a maintained, cross-referenced, self-audited Markdown wiki.Convierte PostgreSQL en una base de conocimiento que se autocompila. Inserta documentos; un LLM los compila en una wiki Markdown mantenida, interconectada y autoauditada.
RAG re-discovers your domain from scratch on every question. IA-SQL implements Andrej Karpathy's LLM Wiki pattern: do the work once, at ingest time, and let knowledge compound. A software metaphor:RAG redescubre tu dominio desde cero en cada pregunta. IA-SQL implementa el patrón LLM Wiki de Andrej Karpathy: haz el trabajo una vez, en la ingesta, y deja que el conocimiento acumule. Una metáfora del software:
INSERT into raw_documents # Layer 1: append-only ground truth -> AFTER INSERT trigger enqueues a job (O(1), never blocks) -> background worker: claim (SKIP LOCKED) -> call external LLM -> write -> compiled_pages + entity_graph # Layer 2: the wiki (owned by the LLM) -> pg_cron nightly lint -> audit pages vs sources -> hallucination_flagsINSERT en raw_documents # Capa 1: ground truth append-only -> trigger AFTER INSERT encola un job (O(1), nunca bloquea) -> background worker: claim (SKIP LOCKED) -> llama al LLM externo -> escribe -> compiled_pages + entity_graph # Capa 2: la wiki (propiedad del LLM) -> lint nocturno (pg_cron) -> audita páginas vs fuentes -> hallucination_flags
A PostgreSQL background worker compiles in the background; your INSERT returns instantly.Un background worker de PostgreSQL compila en segundo plano; tu INSERT retorna al instante.
Sources are append-only, so the whole wiki can be recompiled from scratch anytime.Las fuentes son append-only, así la wiki puede recompilarse desde cero cuando quieras.
A nightly lint checks every claim against the sources and flags hallucinations.Un lint nocturno contrasta cada afirmación con las fuentes y marca alucinaciones.
Any OpenAI-compatible endpoint: Ollama, llama.cpp, vLLM, OpenAI. All via GUCs.Cualquier endpoint compatible con OpenAI: Ollama, llama.cpp, vLLM, OpenAI. Todo por GUCs.
-- feed a document; the wiki compiles itselfalimenta un documento; la wiki se compila sola INSERT INTO ia_wiki.raw_documents (content) VALUES ('PostgreSQL is an extensible, process-based RDBMS...'); -- read the compiled knowledge (no model call at query time)lee el conocimiento compilado (sin llamar al modelo en la consulta) SELECT markdown_body FROM ia_wiki.compiled_pages WHERE page_entity = 'postgresql';