Recall vs PostgreSQL + pgvector

By Arc Labs Research7 min read

Overview

pgvector is a PostgreSQL extension that adds vector search to relational tables. Recall is a memory layer designed for agent loops. The comparison is about database choice vs. memory architecture.

pgvector lets you store embeddings in PostgreSQL and query them with similarity functions. It's SQL-native and works well for structured data (documents, products, users) that also need vector search.

Recall is built specifically for agent memory: storing context, decisions, and outcomes in a format optimized for agent loops. Recall can use pgvector under the hood, but abstracts the schema and retrieval logic for agents.

Feature comparison

FeaturepgvectorRecall
PurposeVector search in PostgresAgent memory layer
Data modelRelational + vectorsStructured agent context
Retrieval interfaceSQL (similarity_search)Agent SDK (retrieve)
Latency50–500ms (depends on query)Sub-50ms (optimized for agent loops)
Schema managementManual (CREATE TABLE, migrations)Automatic (agent-aware defaults)
FilteringFull SQL (WHERE, JOIN)Scoped to agent context
Transaction supportACID transactionsCausal consistency per agent
DeploymentManaged Postgres instanceEmbedded or managed Cloud
Learning curveSQL knowledge requiredAgent SDK only

When to use pgvector

  • Your primary data is relational (users, products, orders)
  • You want to add vector similarity to an existing Postgres database
  • You need complex filtering with WHERE clauses and JOINs
  • You have DBA infrastructure to manage Postgres at scale
  • Your vectors are secondary to structured queries

Example: E-commerce platform with products table that needs similar-product search.

SELECT * FROM products
WHERE embedding <-> query_embedding < 2
ORDER BY embedding <-> query_embedding
LIMIT 10;

When to use Recall

  • You're building agent memory (conversation history, decisions)
  • You need sub-50ms retrieval to keep agent loop latency low
  • You want semantic search + keyword matching (hybrid)
  • You prefer SDKs to SQL
  • You need agent-specific primitives (retrieve, decide, reflect)

Example: Multi-turn agent that needs to remember past conversation context.

const memory = new Recall();
const context = await memory.retrieve({
  agentId: "assistant-1",
  query: "What did the user ask about pricing?",
  topK: 5,
});

Integration patterns

pgvector as Recall's backend: Recall's managed Cloud can use pgvector for persistence. You get agent memory semantics with Postgres durability.

pgvector + Recall: Use pgvector for a document corpus, Recall for agent memory. Agent queries pgvector for documents, then uses Recall to track which documents informed which decisions.

// Document search (pgvector)
const docs = await postgres.query(
  `SELECT * FROM documents
   WHERE embedding <-> $1 < 2
   LIMIT 5`,
  [queryEmbedding]
);

// Agent memory (Recall)
await memory.store({
  agentId,
  content: docs,
  type: "retrieved_documents",
});

Operational overhead

pgvector: Requires Postgres ops (backups, scaling, index tuning). Index maintenance grows with vector count. Good if you already run Postgres.

Recall: Managed Cloud handles ops. Embedding deployment is stateless and scales independently.

Pricing & scaling

pgvector: Postgres hosting (RDS, Managed Postgres, self-hosted). Index size grows with vectors; typically 8 bytes per dimension per vector. For 1M vectors at 1536 dimensions: ~12 GB of storage.

Recall: Pay per vector stored + queries. Typically $0.001 per 1K vectors/month for Cloud.

At <10M vectors, Recall is cheaper. At very large scales (100M+ vectors), pgvector's per-MB hosting cost may be lower, but operational complexity increases.

Summary

  • pgvector: If you own Postgres and need vector search on relational data.
  • Recall: If you're building agent memory and want to avoid SQL infrastructure.

Many teams use both: pgvector for documents, Recall for agent context.

Related reading

Updates from the lab.

Engineering notes, research drops, occasional product updates. Roughly monthly.