Labsco
pretensor-ai logo

Pretensor

โ˜… 5

from pretensor-ai

Connect your data architecture, create a knowledge graph and serve MCP tools for AI to retrieve precomputed models, connections and context.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Pretensor OSS

Pretensor OSS introspects PostgreSQL and Snowflake, with optional BigQuery connector support, builds a Kuzu knowledge graph of tables, columns, foreign keys, inferred joins, and related metadata, and exposes that graph to AI tools through an MCP (Model Context Protocol) server. Agents query schema context and search without issuing raw SQL against your graph store.

Status: Alpha. Pretensor is on PyPI as pretensor and currently in alpha. CLI flags, MCP tools, and graph schema can still change between alpha versions โ€” pin exact versions until 1.0.0. See docs/releases.md for the versioning policy.

Who is this for

  • Data analysts using AI to explore warehouses.
  • Data engineers tired of copy-pasting DDLs into chat.
  • Data architects who need grounded schema context for agents.
  • Anyone feeding database schemas to an LLM by hand.

MCP tools

NameRole
list_databasesList indexed database connections with table counts and staleness.
schemaInspect node labels, edge types, and available properties before writing Cypher.
queryBM25 keyword search over table and entity metadata.
cypherRead-only Kuzu Cypher for one indexed database; mutating clauses are rejected.
contextFull context for one physical table, including columns, joins, lineage, and cluster metadata.
traverseJoin paths between two physical tables, including confirmed cross-database paths.
impactDownstream tables reachable from a table via FK and inferred-join edges.
detect_changesCompare the live database schema to the last indexed snapshot without mutating the graph.
compile_metricCompile semantic-layer YAML into validated SQL for one indexed database.
validate_sqlValidate SQL against the indexed graph before execution.

Architecture

src/pretensor/ is organized by subsystem:

  • connectors/ โ€” database-specific introspection (PostgreSQL, Snowflake, BigQuery)
  • core/ โ€” Kuzu graph store, schema writing, relationship discovery
  • intelligence/ โ€” deterministic graph intelligence (classification, clustering, join-path precomputation; metric-template code exists but is not part of the default OSS indexing flow)
  • mcp/ โ€” MCP server, tools, resources
  • cli/ โ€” Typer CLI (index, reindex, serve, list, quickstart, export, validate, sync-grants, add, remove, plus the semantic subcommand group)

Status

Pretensor is in pre-release development. Before the first packaged release:

  • The package on PyPI is named pretensor. The first stable release will be 1.0.0; everything before that is alpha. pip install pretensor works today because no stable version exists yet โ€” --pre will be required once 1.0.0 ships and future alphas resume.
  • There is no SemVer stability guarantee yet, so CLI flags, MCP tools, and graph schema may change between alphas. Pin exact versions.
  • Treat current builds as evaluation software and test upgrades in a staging environment before production use.

Progress and release notes: CHANGELOG.md.

Tests

make verify

Individual commands are also available:

make test      # pytest
make lint      # ruff check
make typecheck # pyright