Browse/Architecture & Patterns/Two-Database Architecture: Vector DB + Graph DB

Two-Database Architecture: Vector DB + Graph DB

The recommended production architecture combining PostgreSQL pgvector for semantic search with Neo4j for knowledge graph traversal.

Dotzlaw Consulting2025Source

The recommended production architecture uses PostgreSQL with pgvector for vector semantic search and Neo4j for knowledge graph storage and traversal. PostgreSQL handles vector storage with HNSW indexes, full-text search, document storage, and hybrid search with Reciprocal Rank Fusion. Neo4j handles entity and relationship storage, community detection via GDS library, multi-hop graph traversal, and Cypher-based querying. The hybrid retrieval pipeline encodes queries as vectors, runs parallel vector search and graph traversal, fuses results using RRF with k=50, and passes context to the LLM.

Tags

architecturevector-databasegraph-databasepostgresqlneo4jproduction