Skip to content

About

FractalSQL AI Database Extension for PostgreSQL. Vector Search. In-Database Reasoning. Production-Safe Agency. All beside your data.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FractalSQL for PostgreSQL

FractalSQL: Sovereign Data Intelligence

AI Database Extension for PostgreSQL

Vector Search. In-Database Reasoning. Production-Safe Agency. All beside your data.

FractalSQL transforms PostgreSQL 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 PostgreSQL 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 backend 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.

From zero to your first agent

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.

  1. What is this and why do I care?: you are here. Sovereign Data Intelligence, in one page.
  2. How do I get the extension running in 60 seconds? → Getting Started (Docker compose up or the Windows .msi, then your first Scout search).
  3. 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, …).
  4. How does a specific agent work and what are its inputs? → Agent Recipes: the sixteen installable agents, each as a recipe.
  5. How do I use this from my AI client instead of SQL? → MCP Plugin: the fractalsql-postgresql-mcp server exposes the whole function surface as MCP tools for Claude Desktop, Cursor, Windsurf, Claude Code, LangChain, LlamaIndex, CrewAI, or any MCP client.
  6. 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.


🎯 Who are you?

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 grants. → 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.

🧩 What's in the box

FractalSQL for PostgreSQL diagram

Four tiers of SQL-callable primitives, composable into agents with plain PL/pgSQL.
  • Discovery: diverse, mode-collapse-free retrieval: fractal_sfs_converge (Sniper), fractal_search_explore (Scout), fractal_search_telemetry (table-backed top-K), and the indexed fractal_search (nearest rows of a table, through the native IVF index built with fractal_index_create, with every distance still exact).
  • Cognition: in-database LLM integration: fractal_reason (Bedrock, Azure OpenAI, Vertex, Ollama), fractal_embed, fractal_text_to_sql.
  • Agency: self-correcting routines: fractal_search_agent, fractal_sql_agent, fractal_agent_plan_explore, fractal_agent_detect_loop, plus sixteen installable agents: see the Agent Recipes.
  • Analytics: fractal/dimension primitives: fractal_dimension_dfa, fractal_dimension_boxcount, fractal_optimize_portfolio, and more.

Every primitive is an ordinary SQL function, so a domain agent is just a CREATE FUNCTION ... LANGUAGE plpgsql that calls them in sequence. When you're ready to build your own, the Composition Guide walks through the patterns the shipped agents use. See the Agent Blueprint Gallery for full SOC, FinTech, and MedTech reference implementations.

Everything above ships as a ready-made tool surface too: the bundled fractalsql-postgresql-mcp MCP server turns the function catalog into 82 typed tools (the same 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. See MCP Plugin for the client-facing quickstart and mcp/README.md for building and deploying the server binary.


🚀 Get it running

The fastest path is one command: Docker if you just want to try it, or the setup wizard if you have a real PostgreSQL cluster already. See Getting Started for the full 60-second walkthrough.

docker compose up -d   # then connect and run your first Scout search
# Or, on a real Postgres install (Linux/macOS):
git clone https://github.com/FractalSQLabs/fractalsql-postgresql.git && cd fractalsql-postgresql
./scripts/easy_install.sh   # detects your PG install, offers to install the package, walks you through reasoning setup

Native installers (PostgreSQL 14–18): .deb / .rpm for Linux amd64/arm64, a Windows .msi, and a self-contained tarball + install.sh for macOS (arm64/x86_64). See the compatibility table below. easy_install.sh (Linux/macOS) and scripts/windows/easy_install.ps1 (Windows) wrap all of these behind one interactive wizard; no telemetry, everything stays local.


🏛️ Enterprise Tier

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 claim, what an autonomous agent decided and why, an optional drop-in library adds a tamper-evident, hash-chained decision ledger: no rebuild, no extension reload, activated by a single GUC. See Enterprise Tier for the full mechanism, including what the hash chain can and can't prove.


📊 Compatibility & License

PostgreSQL Linux amd64 Linux arm64 Windows x64 macOS
14 ✓ ✓ ✓ ✓
15 ✓ ✓ ✓ ✓
16 ✓ ✓ ✓ ✓
17 ✓ ✓ ✓ ✓
18 ✓ ✓ ✓ ✓

macOS builds cover Apple Silicon and Intel.

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.


📚 Documentation

Follow the path above; the links below are the same steps, expanded.

About

FractalSQL AI Database Extension for PostgreSQL. Vector Search. In-Database Reasoning. Production-Safe Agency. All beside your data.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages