Pretensor

by pretensor-ai

Not rated
GitHub

About

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

Details

Author
pretensor-ai
Categories
Developer Tools, Knowledge Base, Other, AI

Setup

Install Pretensor in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/pretensor-ai/pretensor

Follow the installation instructions in the repository README, then restart your MCP client.

Pretensor OSSintrospectsPostgreSQLandSnowflake, with optionalBigQueryconnector support, builds aKuzuknowledge graph of tables, columns, foreign keys, inferred joins, and related metadata, and exposes that graph to AI tools through anMCP(Model Context Protocol) server. Agents query schema context and search without issuing raw SQL against your graph store.

Status: Beta.Pretensor is on PyPI aspretensor;0.1.0is the first non-alpha release. CLI flags, MCP tools, and graph schema can still change between minor versions — pin exact versions until1.0.0. Seedocs/releases.mdfor the versioning policy.

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

- Python 3.11 or 3.12(3.13 not yet tested).
- A reachable database forpretensor index. Every database driver ships as an extra — PostgreSQL viapretensor
[postgres], Snowflake viapretensor[snowflake], BigQuery viapretensor[bigquery].

# Indexing PostgreSQL? Install the postgres extra: pip install 'pretensor[postgres]' # or, inside a uv-managed environment: uv pip install 'pretensor[postgres]'

Heads-up:the database drivers arenotbundled in the base install. A barepip install pretensorinstalls the CLI and MCP server butno DB driverpretensor index postgresql://…will then fail at connect time withPostgres connector requires psycopg2. Install the Postgres extra: pip install 'pretensor[postgres]' (or pip install psycopg2-binary).Install the extra matching your database (postgres,snowflake,bigquery, ormysql), orpretensor[all-connectors]for all of them.

Optional features are exposed as extras:

Combine extras with comma separation, e.g.pip install 'pretensor[postgres,clustering]'.

A note on versions.From0.1.0on, plainpip install pretensorresolves to the latest non-alpha release, and pre-releases require--pre(e.g.pip install --pre pretensor). Pin to a specific version (e.g.pretensor==<version>) if you want a deterministic install — see thePyPI badge abovefor the latest.

If you want to hack on Pretensor itself rather than use it, see the contributor setup inCONTRIBUTING.mdfor thegit clone+make installflow.

pretensor index postgresql://USER:PASSWORD@HOST:5432/DBNAME pretensor serve --config-only # prints mcpServers JSON for Claude / Cursor

serve --config-onlyprints themcpServersJSONto stdout. Merge thepretensorentry into your Claude or Cursor MCP settings — the IDE starts the server automatically. Runpretensor servedirectly if you prefer a long-running terminal process (config hints go to stderr, keeping stdout clean for JSON-RPC).

Use--state-dironindex/reindexand--graph-dironservewhen overriding the default state directory (.pretensor).

Full guide — install, tools, visibility, reindexing, graph visualization:guides/quickstart.md

pretensor analyze path/to/service-repo --connection mydb

analyzescans a repository for SQL string literals in Python source (stdlib AST — no code is executed), resolves each statement's table references with sqlglot, and links the issuing code to the matching tables in the graph as external consumers: service, file, line range, read/write op, and a confidence score. Raw SQL text is never stored, only a fingerprint. The results power theconsumersMCP tool and enrichimpact, so an agent can answer "which services consume this table?" with provenance.

Useful flags:--servicelabels the scanned repo (defaults to the directory name),--default-schemasets the schema assumed for unqualified table names,--dry-runpreviews without writing,--jsonemits a machine-readable summary. A# noqa: pretensor-analyzecomment on or above a statement opts it out.

Agents that don't run over MCP can still reach the graph tools. Pretensor exposesschema,context,traverse,impact,query, andvalidate_sqlas native tool objects for LangChain, LlamaIndex, and Google ADK — no MCP server process required. The adapters call the same underlying functions the MCP server uses, so output is identical.

from pathlib import Path from pretensor.integrations import load_langchain_tools # or load_llamaindex_tools, load_adk_tools tools = load_langchain_tools(Path(".pretensor"))

Install the matching extra (pretensor[langchain],pretensor[llama-index], orpretensor[google-adk]). Thedocs/agent-framework-adapters.mdfile has a full example per framework.

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)
- enrichment/— optional graph enrichment passes (dbt manifest,analyzecode scanner)
- mcp/— MCP server, tools, resources
- cli/— Typer CLI (index,reindex,analyze,serve,list,quickstart,export,validate,sync-grants,add,remove, plus thesemanticsubcommand group)

- The package on PyPI is namedpretensor.0.1.0is the first non-alpha release; pre-releases published after it require--preto install.
- There is no SemVer stability guarantee before1.0.0, so CLI flags, MCP tools, and graph schema may still change between releases. Pin exact versions.
- Test upgrades in a staging environment before production use.

Progress and release notes:CHANGELOG.md.

SeeCONTRIBUTING.md. Security issues: seeSECURITY.md.

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

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Authenticated MCP and agent gateway for Forge Cascade private AI memory, provenance, graph search, and capsule lineage.

Local-first RLHF feedback loop for AI agents — capture preference signals, promote memories, block repeated mistakes, export DPO/KTO training pairs

Smriti is a Model Context Protocol (MCP) server that provides persistent, graph-based memory for LLM applications. Built on LadybugDB (embedded property graph database), it uses EcphoryRAG-inspired multi-stage retrieval - combining cue extraction, graph traversal, vector similarity, and multi-hop association - to deliver human-like memory recall.

A server for Zero-Vector's hybrid vector-graph persona and memory management system, featuring advanced LangGraph workflow capabilities.

Adaptive MCP memory system for AI applications. Learns which retrieval strategies work for your data, scores results using cognitive science models, builds a knowledge graph automatically, and validates every parameter change against real query history before adopting it. Patent pending.

Persistent memory for AI agents. Single SQLite file, 192 MCP tools. FTS5 search, knowledge graph, session handoffs, write gate. No server, no API keys, no LLM calls.

Multimodal RAG for source-backed AI answers

Corpus search and linguistic analysis for AI Agents

Highly efficient context management for agentic AI: MCP code search, evidence packs, graph context, and memory for large projects.

Self-hosted Rust-based MCP server for AI agent memory — persistent, queryable memory with hybrid search, knowledge graphs, built-in embeddings, and 14 core tools (expandable to 86+ with profile-based tiering).

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.