Vector Search. In-Database Reasoning. Production-Safe Agency. All beside your data.
FractalSQL transforms SQLite from a passive data store into an active agentic database. FractalSQL adds what traditional RAG (Retrieval-Augmented Generation) stops short of: reasoning over what it retrieves, and when you enable it acting on the result, whether that's running a generated query or executing a decision an agent computed, all inside the same database process.
By bringing reasoning and agency directly into the SQLite backend, FractalSQL enables Sovereign Data Intelligence: the ability to reason, plan, and act upon your data with the deployment topology under your control. Run fully on-prem or in your own containers with Ollama/vLLM for zero data egress, or point at your organization's cloud AI accounts (Bedrock, Azure OpenAI, Vertex), where your compliance posture requires it for managed-model scale. You control the trade, not the product.
| Traditional RAG Stack | The Sovereign Way (FractalSQL) |
|---|---|
| Mode Collapse: top-K search returns near-duplicates, starving the LLM of diverse context. | Scout Discovery: MMR-style diverse semantic search that discovers the data's real structure. |
| Fragmented Logic: app pulls rows, calls LLM, handles retries, and glues answers in middleware. | In-Database Reasoning: reasoning and embedding happen inside the SQLite host process itself. |
| Passive Retrieval: you ask a question, the DB returns rows, and you hope the LLM is correct. | Autonomous Agency: self-correcting SQL, loop detection, and trajectory forecasting. |
FractalSQL's docs follow a single linear path. Each step answers one question and hands off to the next. You don't need to read everything; follow the path.
- What is this and why do I care?: you are here. Sovereign Data Intelligence, in one page.
- How do I get the extension running in 60 seconds? → Getting Started (
.loadthe extension, then your first Scout search). - How do I apply this to my industry? → Starter Kits: runnable, industry-specific SQL scripts (SOC, FinTech, MedTech, Fleet, Smart-Cities, automotive, aerospace, telecom, climate tech, RF, …).
- How does a specific agent work and what are its inputs? → Agent Recipes: the built-in agents, each as a recipe.
- How do I use this from my AI client instead of SQL? → MCP Plugin: the
fractalsql-sqlite-mcpserver exposes the whole function surface as MCP tools for Claude Desktop, Cursor, Windsurf, Claude Code, LangChain, LlamaIndex, CrewAI, or any MCP client. - How do I build a proprietary agent that isn't in the box? → Composition Guide: the design patterns behind the recipes.
New here? Step 2 is a one-command demo. Step 3 drops you into a vertical that looks like your problem. Step 4 is the reference you'll keep coming back to.
Depending on your role, you'll want to start in different places:
- AI Engineer: You want to improve RAG quality and reasoning. → Start with docs/features.md and docs/reasoning-setup.md.
- DBA / Security Architect: You care about stability, safety, and access control. → See the Safety & Governance guide.
- Product Developer: You want to build agentic features quickly. → Run the Docker Demo, then pick a Starter Kit.
- Tool Builder / Platform Engineer: You want Claude Desktop, Cursor, Windsurf, an agent framework (LangChain, LlamaIndex, CrewAI), or your own runtime speaking to the database directly. → Serve the MCP Plugin; the server-side details live in mcp/README.md.
Four tiers of SQL-callable primitives, composable into agents with plain SQL and application code: no server-side language required.
- Discovery: diverse, mode-collapse-free retrieval:
fractal_sfs_converge(Sniper),fractal_search_explore(Scout), and the indexedfractal_search(nearest rows of a table, through the native IVF index built withfractal_index_create, with every distance still exact). - Cognition: in-process LLM integration:
fractal_reason(Bedrock, Azure OpenAI, Vertex, Ollama),fractal_embed,fractal_text_to_sql. - Agency: self-correcting routines: the search/sql agents, plan/trajectory/loop-detection helpers; see the Agent Recipes.
- Analytics: fractal/dimension primitives:
fractal_dimension_dfa,fractal_dimension_boxcount,fractal_optimize_portfolio, and more.
Plus SQLite-native plumbing: fractal_vector as a canonical BLOB type,
fractal_config_set()/fractal_config_get() per-connection configuration, the background
fractal_vectorizer embedding pipeline, and the tamper-evident
fractal_ledger_* audit surface. The full function-surface reference with
runnable examples lives in sql/fractalsql--1.0.sql.
Everything above ships as a ready-made tool surface too: the bundled
fractalsql-sqlite-mcp MCP server turns the function catalog into 89 typed
tools (the same engine-filtered surface every release verifies against committed
integrity locks). It speaks standard MCP over stdio or HTTP, so it drops into
any client or framework that does the same -- Claude Desktop, Cursor, Windsurf,
Claude Code, LangChain, LlamaIndex, CrewAI, the Vercel AI SDK -- under any
deployment topology from a single local file to enterprise cloud reasoning
backends; see Deployment topologies.
See MCP Plugin for the client-facing quickstart and
mcp/README.md for building and deploying the server binary.
Reasoning is opt-in and provider-pluggable: the fractalsql-reasoning-http
plugin speaks the OpenAI chat-completions wire format, so any OpenAI-compatible
endpoint works. Without a plugin configured, Discovery and Analytics are fully
functional and Cognition/Agency return clean precondition errors.
The fastest path is one command: Docker if you just want to try it, or the setup wizard if you have a real sqlite3 CLI install already. See Getting Started for the full walkthrough.
docker compose up -d # or: docker build -t fractalsql-sqlite .
# then .load the extension and run your first Scout search# Or, on a real install (Linux/macOS):
curl -fsSL https://github.com/FractalSQLabs/fractalsql-sqlite/releases/latest/download/easy_install.sh | bash
# Windows: scripts/windows/easy_install.ps1Native installers: .deb / .rpm for Linux amd64/arm64 (glibc and musl
channels), a Windows .msi (x64), and a self-contained tarball
for macOS (arm64/x86_64). easy_install.sh (Linux/macOS) and
easy_install.ps1 (Windows) wrap all of these behind one interactive
wizard; no telemetry, everything stays local.
Because configuration is per-connection (fractal_config_set, since SQLite has no
GUCs to persist), the wizard writes a load_fractalsql.sql bootstrap
snippet you pass to every session: sqlite3 -init load_fractalsql.sql mydb.sqlite.
Everything above is Community edition and fully functional on its own. Discovery, Cognition, and Agency don't depend on anything in this section. For regulated environments that need to prove, not just trust, a decision: the Enterprise tier adds a tamper-evident, HMAC-sealed decision record; Enterprise Tier has the full mechanism, including what the ledger can and can't prove.
| SQLite | Linux amd64 | Linux arm64 | Linux musl | Windows x64 | macOS |
|---|---|---|---|---|---|
| 3.25+ | ✓ | ✓ | ✓ | ✓ | ✓ |
Linux musl (Alpine) covers amd64 and arm64. macOS builds cover Apple Silicon and Intel.
Any SQLite host that permits sqlite3_load_extension: the sqlite3 CLI,
Python's sqlite3 module (conn.enable_load_extension), better-sqlite3,
libSQL/Turso-compatible hosts, mobile SQLite bridges. Verified on AWS
Graviton, Apple Silicon, Ampere Altra, and Raspberry Pi.
License: Apache-2.0. See LICENSE. Third-party components are under
their own permissive licenses (BSD-2-Clause, MIT, and others) --
see THIRD-PARTY-NOTICES.md.
For enterprise editions, licensing, and support, contact enterprise@fractalsqlabs.com.
Follow the path above; the links below are the same steps, expanded.
- Getting Started: 60-second Docker / native install.
- Starter Kits: industry-specific runnable SQL scripts.
- Agent Recipes: the sixteen installable agents, each as a recipe.
- Composition Guide: build your own agent.
- Features: the full Capability Map and API reference.
- Reasoning Setup: LLM provider configuration (Ollama, OpenAI, Bedrock, Azure, Vertex).
- Text-to-SQL Setup: pipeline details and the security model.
- Vectorizer Setup: automatic embedding pipelines.
- MCP Plugin: use FractalSQL from Claude Desktop, Cursor, Windsurf, LangChain, LlamaIndex, CrewAI, and many more MCP clients.
- Docker Demo: a one-command end-to-end demo.
- Agent Blueprint Gallery: the vertical demos and reference agents.
- Enterprise Tier: the tamper-evident decision ledger (CISO/audit).

