View memory

Instructions for AI Assistants

Current state: Memory loaded
Next action: Read the memory content above. To search more, fetch /recall.
Fetch this URL: /memory/8f4710ae-6efd-4ca5-811b-af5c748f50cf

Memory

# IntelligentRAG — SurrealDB-Native Architecture (Final) ## Key Design Decision All processing happens INSIDE SurrealDB. The Worker just stores raw data and invokes SurrealDB functions. ## SurrealDB Functions (3) - `fn::embed($text)` — Generate embedding via Workers AI http::post() - `fn::llm($system, $user)` — Call LLM via http::post(), return raw response - `fn::search($query, $collection_id, $limit)` — Hybrid vector + BM25 with RRF ## SurrealDB Events (2) - `auto_chunk_document` — On document CREATE, auto-chunk and notify - `auto_alert_entity` — On entity CREATE, notify ## SurrealDB API Endpoints (3) - `POST /ingest` — Create document (triggers event → chunking) - `POST /search` — Hybrid search via fn::search - `GET /health` — Document/entity/chunk counts ## Worker Architecture The Worker is a thin MCP server that: 1. Stores raw documents in SurrealDB 2. SurrealDB events auto-process (chunk, embed) 3. Worker calls fn::llm() for entity extraction (parsed in Worker) 4. Worker creates graph edges in SurrealDB 5. Worker invokes fn::search() for retrieval ## SurrealDB 3.2 Gotchas Learned - Use `surrealkv://` not `file://` for storage - Use `/rpc` endpoint not `/sql` for queries - No `string::indexOf` — use `string::contains` - No `parse::json` — parse JSON in Worker - No WHILE loops in functions - KNN syntax: `<|k, EF|>` not `<|k, KNN|>` - No `+=` operator in functions - `DEFINE API` needs `OVERWRITE` not `IF NOT EXISTS` - Objects use `{{}}` double braces - `id` field is automatic, don't define it

Tags: architecture, surrealdb, native, functions, events, final, project:intelligentrag, kind:semantic, status:canonical — Source: claude — 2026-07-16 20:58:57 UTC

Connected memories

What would you like to do next?