polygres
// built by Evokoa

Internal search that feels like extended context.

Polygres turns the Postgres you already run into internal search for AI agents. Rows, relationships, embeddings: one hybrid query, one ranked answer. Stop stuffing prompts. Start searching.

*First query in minutes*
CLI

Polygres CLI is now live.

Manage projects, import data, and run queries directly from your terminal. Built for speed, automation, and AI agents.

$pip install polygres-cli

Available on PyPI

// extended context

Why it feels like extended context.

Because from your agent's side, that is exactly how it behaves. It searches for what it needs the moment it needs it, and the answer is already there. No window to ration. No history to compress. No guessing which rows to bring.

A model's context windowYour database, still going
01 //

It never runs out of room

Ten rows or ten million, the prompt stays the same shape. Every answer arrives sized to the agent's budget, so nothing useful gets dropped to make room for something else.

02 //

It never forgets

Every row, relationship, and past interaction stays addressable for as long as it lives in your database. Nothing ages out. Nothing gets summarized into something vaguer.

03 //

You stop curating context

No deciding in advance which tables might matter. The agent asks, and the right rows come back ranked, per query, in milliseconds.

The mechanism is search, not a bigger model. The outcome is an agent that works like your whole database is sitting in the prompt.

// source to context

Any Postgres in.
Ranked context out.

Host your database on Polygres, or plug in Supabase, Neon, or anything with a connection string. Every query fans out across graph traversal and ten search methods at once, then fuses into one ranked, token-ready context block.

*First query in minutes*
polygres// host on polygres
Supabase// connect existing
Neon// connect existing
PostgreSQL// any connection string
// pgGraph × pgContext

Every kind of search.
Already in your database.

Two open source engines cover the whole retrieval surface, from dense vectors to graph hops. No sidecar services, no sync jobs. If a row is in Postgres, it's searchable.

Full Graph Engine

Your foreign keys become a compiled graph. Multi-hop traversal, shortest paths, and neighborhood search over the tables you already have, at memory-scan speed.

traversalshortest pathneighborhoodcomponentsGQL / Cypher
evokoa/pggraph

AI Native Search

Ten ways to search, one engine. Every method runs against your live tables at once, and a single fusion pass re-scores every hit exactly.

Dense vector search

Embeddings live in HNSW indexes inside Postgres, quantized to stay in memory. Nearest neighbors come back in milliseconds.

dense HNSWquantized

Sparse & full-text

Full-text and sparse retrieval catch the exact keywords, ids, and codes that embeddings alone would miss, with scalar filters applied in the same pass.

sparsefull-textfiltered

Discovery & lookup

Recommend related rows, surface what the agent didn't know to ask for, group results, or jump straight to a record by key.

late-interactionrecommenddiscovergroupedlookup

Exact fusion

Every channel streams into one fusion pass: merged, deduplicated, re-ranked. One ranked list out, never ten to reconcile.

// hybrid retrieval

Context assembly is one call.

Say what the agent needs. Semantic match, graph hops, scalar filters. Polygres hands back a ranked, token-ready context block. No vector store. No sync layer. No glue code.

Read the documentation
# build_context.py
# everything the agent needs, in one query
context = polygres.retrieve(
    query="why did order #8231 fail?",
    graph_hops=2,  # orders → payments → disputes
    filters={"status": "failed"},
    limit_tokens=8_000,
)

agent.run(context)  # grounded in your database
// database-scale context

Stop rationing tokens.

Models cap out at a few million tokens. Your database doesn't. Search turns every row into working memory, fetched the moment your agent needs it.

*First query in minutes*

Unbounded

Effective context. Every row is addressable.

Milliseconds

HNSW and graph retrieval, indexed in Postgres.

One query

Relational, graph, and vector. Joined at the source.

// open source

Built in the open.

pgGraph and pgContext, the engines under Polygres, are open source Postgres extensions. Read the code, run them on your own cluster, send a PR. It's your database. You're never locked in.

// github stars
// get started

Give your agents the whole database.

Deploy a managed instance in seconds. Or point the open source SDK at your existing schema.

Start Building with Polygres

Host on Polygres, or connect Supabase, Neon, or any hosted Postgres. Graph traversal, vector search, and hybrid retrieval built in.

*Deploy in seconds*
Polygres