Skip to content

damiandelmas/flex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flex

flex

PyPI License: MIT Python 3.12+

Vector and hybrid retrieval for structured data. Flex compiles any data source into a SQLite database with embeddings, knowledge graphs, and structured views. Installing flex registers an MCP endpoint with a single tool — the AI agent reads the schema and writes SQL against the database.

curl -sSL https://getflex.dev/install.sh | bash

what's inside

  • flexvec — SQL vector retrieval kernel. suppress, diversify, decay, trajectory — composable operations on the score array before selection. paper.
  • MCP server — a single read-only tool (flex_search). The agent discovers the schema at runtime and writes SQL.
  • worker — a background service that detects new data and embeds it within seconds.
  • modules — data source adapters. claude_code ships built-in.

claude code

The claude_code module indexes your entire Claude Code session history — file lineage, decision archaeology, weekly digests. One install command.

curl -sSL https://getflex.dev/install.sh | bash -s -- claude-code

The installer scans existing sessions, embeds everything, starts a background worker, and registers the MCP server.

"Use flex: what's the history of worker.py?"
"Use flex: what did we build this week?"
"Use flex: how did we create the curl install script?"

claude code docs

how it works

data source
       │
  [compile]  parse → chunks + metadata + embeddings
       │
       ▼
  SQLite database
       │
  [manage]  knowledge graph, fingerprints, project attribution
       │
  [MCP server]  read-only SQL surface
       │
       ▼
  AI agent writes SQL

Each database is a single .db file with the same schema — chunks, edges, enrichments, and views. The database describes itself; the agent discovers what's available at query time.

local-first

ls ~/.flex/cells/
claude_code.db    284M

sqlite3 claude_code.db "SELECT COUNT(*) FROM sessions"
4547

Everything runs in-process. No external services, no cloud dependency.


curl -sSL https://getflex.dev/install.sh | bash

MIT · Python 3.12 · SQLite · getflex.dev · paper · x