Graph-aware embeddings for RAG and AI agents

Papr upgrades the vector embeddings you already have into graph-native embeddings. Instead of ranking documents only by cosine similarity, Papr attaches relational signals — entities, relations, time, and ownership — to every vector and uses them to rerank results against the intent of the query. The result: your retrieval returns the right answer, not just the most similar-looking one.

Why cosine similarity is not enough

Dense embeddings measure how close two pieces of text are in meaning. They cannot tell whether a document is the current version, whether it was approved, which subsidiary it belongs to, or who is allowed to see it. Ask a typical RAG system “What is our refund policy?” and an outdated v1.2 policy or an unapproved regional draft can easily outrank the current v2.0 document, because they are all about refunds. None of that context lives inside a vector.

How Papr graph-aware embeddings work

One API call attaches 14 relational dimensions to each embedding at index time. At query time, those signals rotate the vector space and rerank candidates, so the document that actually answers the question ranks higher on average.

  • Embed with any model you already use — OpenAI, Cohere, Voyage, or open source.
  • Transform each vector once with Papr, which rotates it using graph signals such as entities, relations, and temporal context.
  • Store the rotated and signal vectors in your existing vector database.
  • Rerank the top-K cosine results at query time by scoring each candidate's signals against the query's intent.

Three steps to integrate

Keep your embedding model and your vector database. Add one call at index time and one at query time:

export PAPR_API_KEY="pk_..."

# after your existing embed call
phases = papr.transform(doc, vec)

# after your existing vector search
ranked = papr.rerank(q, hits)

Benchmarks: graph-aware reranking vs. semantic baselines

Papr numbers below apply graph-aware reranking on top of the same dense base encoder, evaluated on three public retrieval benchmarks spanning entity-graph QA, code search, and scientific fact retrieval. Higher is better.

BenchmarkMetricBest baselinePapr graph rerank
Stanford STaRK-Prime (biomedical entity QA)Hit@138.9 (Multi-VSS)47.4
CoSQA, MTEB (20,604 Python functions)NDCG@1042.4 (voyage-code-3)49.1
SciFact (5,183 abstracts, 300 expert claims)NDCG@1080.4 (NV-Embed-v2)83.7

Use cases

  • Enterprise RAG: surface the current, approved policy instead of stale or draft versions.
  • AI agent memory: give agents context about who, what, and when — not just topic similarity.
  • Code search: find the function that actually implements the behavior you asked about.
  • Scientific and technical retrieval: match claims to the evidence that supports them.

Privacy by design

Nothing is stored and nothing is persisted. Your data passes through the Papr API over TLS 1.3, is processed in memory, and is immediately discarded — no databases, no payload logs, no copies. Your vectors stay in your own vector database; Papr sits between retrieval and ranking. VPC deployment, audit logs, and custom data processing agreements are available for enterprise teams.

Get a free API key or read the developer documentation.