Vector search, embeddings, and ML primitives in PostgreSQL, with optional services for agents, MCP, and a desktop UI.
Tip
New here? Start with Docs/getting-started/simple-start.md or jump to QUICKSTART.md.
Developer Tools: Try the quickstart data pack, SQL recipe library, and CLI helpers for faster development!
Get vector search working in under a minute:
📋 Quick Start Checklist
- Docker and Docker Compose installed
- Ports 5433, 8080, 8081, 3000 available
- 4 GB+ RAM available
- Ready to run commands
Step 1: Start PostgreSQL with NeuronDB
# Start NeuronDB (CPU profile, default)
docker compose up -d neurondb
# Wait for service to be healthy (about 30-60 seconds)
docker compose psStep 2: Create Extension
# Connect and create extension
psql "postgresql://neurondb:neurondb@localhost:5433/neurondb" \
-c "CREATE EXTENSION IF NOT EXISTS neurondb;"Step 3: Create Table, Insert Vectors, and Search
# Create table, insert vectors, create index, and search
psql "postgresql://neurondb:neurondb@localhost:5433/neurondb" <<EOF
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
content TEXT,
embedding vector(3)
);
INSERT INTO documents (content, embedding) VALUES
('Machine learning algorithms', '[0.1,0.2,0.3]'::vector),
('Neural networks and deep learning', '[0.2,0.3,0.4]'::vector),
('Natural language processing', '[0.3,0.4,0.5]'::vector);
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops);
SELECT id, content, embedding <=> '[0.15,0.25,0.35]'::vector AS distance
FROM documents
ORDER BY embedding <=> '[0.15,0.25,0.35]'::vector
LIMIT 3;
EOFExpected output:
id | content | distance
----+------------------------------------+-------------------
1 | Machine learning algorithms | 0.141421356237309
2 | Neural networks and deep learning | 0.173205080756888
3 | Natural language processing | 0.244948974278318
(3 rows)
[!SUCCESS] Congratulations! You've successfully set up vector search. The results show documents ordered by similarity to your query vector, with the closest match first.
[!SECURITY] The default password (
neurondb) is for development only. Always change it in production by settingPOSTGRES_PASSWORDin your.envfile. See Service URLs & ports for connection details.
Expand full table of contents
NeuronDB enables you to build powerful AI applications directly in PostgreSQL:
🔍 Semantic & Hybrid Search
Combine vector similarity with SQL filters and full-text search:
-- Find similar documents with metadata filters
SELECT content, embedding <=> query_vector AS similarity
FROM documents
WHERE category = 'technology'
AND created_at > '2024-01-01'
ORDER BY embedding <=> query_vector
LIMIT 10;Use cases:
- Document search with filters
- Product recommendations
- Content discovery
- Similarity matching
📄 RAG Pipelines
Build retrieval-augmented generation systems with Postgres-native primitives:
-- Generate embedding for query
WITH query AS (SELECT embed_text('your question') AS q_vec)
-- Retrieve relevant context
SELECT content, embedding <=> q.q_vec AS distance
FROM documents, query q
ORDER BY embedding <=> q.q_vec
LIMIT 5;Use cases:
- Question answering systems
- Document Q&A
- Knowledge bases
- Chatbots with context
🤖 Agent Backends
Create AI agents with durable memory and tool execution:
- ✅ Persistent memory with vector search
- ✅ Tool execution (SQL, HTTP, Code, Shell)
- ✅ Multi-agent collaboration
- ✅ Workflow orchestration
- ✅ Budget and cost management
Use cases:
- Autonomous agents
- Workflow automation
- Data analysis agents
- Customer service bots
🔌 MCP Integrations
Connect MCP clients (Claude Desktop, etc.) to NeuronDB:
- ✅ 600+ tools available via MCP
- ✅ Vector operations
- ✅ ML pipeline tools
- ✅ PostgreSQL administration
- ✅ Dataset loading
Use cases:
- Claude Desktop integration
- LLM tool access
- Database management via LLMs
- Automated workflows
📊 Feature Comparison
| Feature | NeuronDB | Typical Alternatives |
|---|---|---|
| Index types | HNSW, IVF, PQ, hybrid, multi-vector | Limited (usually just HNSW) |
| GPU acceleration | CUDA, ROCm, Metal (3 backends) | Single backend or CPU-only |
| Benchmark coverage | RAGAS, MTEB, BEIR integrated | Manual setup required |
| Agent runtime | ✅ NeuronAgent included | ❌ External services needed |
| MCP server | ✅ NeuronMCP included (600+ tools) | ❌ Separate integration required |
| Desktop UI | ✅ NeuronDesktop included | ❌ Build your own |
| ML algorithms | 52+ algorithms | Extension only (limited) |
| SQL functions | 665+ functions | Typically <100 |
🎯 Key Advantages
- 10x faster HNSW index building than pgvector
- SIMD-optimized distance calculations
- GPU acceleration for embeddings and ML
- Efficient memory management
- Complete ecosystem - Database + Agent + MCP + UI
- SQL-first - Everything accessible via SQL
- Rich tooling - CLI helpers, examples, recipes
- Comprehensive docs - 60+ documentation files
- Production features - Monitoring, backups, HA
- Security - RBAC, encryption, audit logging
- Scalability - Horizontal and vertical scaling
- Observability - Prometheus metrics, structured logging
Choose what you need:
| Component Setup | Command | What you get |
|---|---|---|
| NeuronDB only (extension) | docker compose up -d neurondb |
Vector search, ML algorithms, embeddings in PostgreSQL |
| NeuronDB + NeuronMCP | docker compose up -d neurondb neuronmcp |
Above + MCP server for Claude Desktop, etc. |
| NeuronDB + NeuronAgent | docker compose up -d neurondb neuronagent |
Above + Agent runtime with REST API |
| Full stack | docker compose up -d |
All components including NeuronDesktop UI |
Note
All components run independently. The root docker-compose.yml starts everything together for convenience, but you can run individual services as needed. You can also run each component independently (see component READMEs).
Option 1: Use published images (recommended)
Pull pre-built images from GitHub Container Registry:
# Pull latest images
docker compose pull
# Start services
docker compose up -d
# Wait for services to be healthy (30-60 seconds)
docker compose ps
# Verify all services are running
./scripts/neurondb-healthcheck.sh quickWhat you'll see:
- 5 services starting:
neurondb,neuronagent,neuronmcp,neurondesk-api,neurondesk-frontend - All services should show "healthy" status after initialization
Tip
For specific versions, see Container Images documentation. Published images are available starting with v1.0.0.
Option 2: Build from source
# Build and start all services
docker compose up -d --build
# Monitor build progress (first time takes 5-10 minutes)
docker compose logs -f
# Once built, wait for services to be healthy
docker compose ps
# Verify all services are running
./scripts/neurondb-healthcheck.sh quickBuild time: First build takes 5-10 minutes depending on your system. Subsequent starts are 30-60 seconds.
Prerequisites checklist
- Docker 20.10+ installed
- Docker Compose 2.0+ installed
- 4 GB+ RAM available
- Ports 5433, 8080, 8081, 3000 available
Important
Prefer a step-by-step guide? See QUICKSTART.md.
New Developer Tools: After setup, try the quickstart data pack for sample data, SQL recipe library for ready-to-run queries, and CLI helpers for index management!
[!SECURITY] Default credentials are for development only. In production, set strong passwords via environment variables or
.envfile.
Install components directly on your system without Docker.
Install the NeuronDB extension directly into your existing PostgreSQL installation.
Build and install steps
Prerequisites:
- PostgreSQL 16, 17, or 18 development headers
- C compiler (gcc or clang)
- Make
Build:
cd NeuronDB
make
sudo make installEnable extension:
CREATE EXTENSION neurondb;Configure (if needed):
Some features require preloading. Add to postgresql.conf:
shared_preload_libraries = 'neurondb'Then restart PostgreSQL:
sudo systemctl restart postgresqlConfiguration parameters (GUCs):
# Vector index settings
neurondb.hnsw_ef_search = 40 # HNSW search quality
neurondb.enable_seqscan = on # Allow sequential scans
# Memory settings
neurondb.maintenance_work_mem = 256MB # Index build memoryUpgrade path:
-- Check current extension version
SELECT extversion FROM pg_extension WHERE extname = 'neurondb';
-- Expected output: 2.0
-- Upgrade to latest (if newer version available)
ALTER EXTENSION neurondb UPDATE;
-- Verify upgrade (returns JSONB with detailed version info)
SELECT neurondb.version();[!NOTE]
SELECT extversion FROM pg_extension WHERE extname = 'neurondb';returns the extension version as text (e.g.,2.0).
SELECT neurondb.version();returns a JSONB object with version, PostgreSQL version, and capabilities information.
For detailed installation instructions, see NeuronDB/install.md.
Install NeuronMCP, NeuronAgent, and NeuronDesktop from source with automated scripts.
Quick Installation:
# Install all components
sudo ./scripts/install-components.sh
# Install specific components
sudo ./scripts/install-components.sh neuronmcp neuronagent
# Install with system services enabled
sudo ./scripts/install-components.sh --enable-servicePrerequisites:
- Go 1.23+ (for building)
- PostgreSQL 16+ with NeuronDB extension
- Node.js 18+ (for NeuronDesktop)
Manual Installation:
See Native Installation Guide for detailed instructions.
Service Management:
# Start services
./scripts/manage-services.sh start
# Check status
./scripts/manage-services.sh status
# View logs
./scripts/manage-services.sh logs neuronagentFor service management details, see Service Management Guide.
Use NeuronDB as a PostgreSQL extension only, without the Agent, MCP, or Desktop services.
Benefits:
- ✅ No extra services or ports
- ✅ Minimal resource footprint
- ✅ Full vector search, ML algorithms, and embeddings
- ✅ Works with any PostgreSQL client
Installation:
Follow the Native install steps above. That's it! You now have vector search and ML capabilities in PostgreSQL.
Usage:
-- Create a table with vectors
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
content TEXT,
embedding VECTOR(1536)
);
-- Create HNSW index
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops);
-- Vector similarity search
SELECT id, content
FROM documents
ORDER BY embedding <=> '[0.1, 0.2, ...]'::vector
LIMIT 10;No additional services, ports, or configuration required!
| Service | How to reach it | Default credentials | Notes |
|---|---|---|---|
| NeuronDB (PostgreSQL) | postgresql://neurondb:neurondb@localhost:5433/neurondb |
User: neurondb, Password: neurondb |
Container: neurondb-cpu, Service: neurondb |
| NeuronAgent | http://localhost:8080/health |
Health: no auth. API: API key required | Container: neuronagent, Service: neuronagent |
| NeuronDesktop UI | http://localhost:3000 |
No auth (development mode) | Container: neurondesk-frontend, Service: neurondesk-frontend |
| NeuronDesktop API | http://localhost:8081/health |
Health: no auth. API: varies by config | Container: neurondesk-api, Service: neurondesk-api |
| NeuronMCP | stdio (JSON-RPC 2.0) | N/A (MCP protocol) | Container: neurondb-mcp, Service: neuronmcp. No HTTP port. |
Warning
Production Security: The default credentials shown above are for development only. Always use strong, unique passwords in production. Set POSTGRES_PASSWORD and other secrets via environment variables or a .env file (see env.example).
- Start here:
Docs/documentation.md(documentation index) - Beginner walkthrough:
Docs/getting-started/simple-start.md- Step-by-step guide for beginners - Technical quick start:
QUICKSTART.md- Fast setup for experienced users - Complete guide:
Docs/getting-started/installation.md- Detailed installation options - Official docs:
neurondb.ai/docs- Online documentation
NeuronDB documentation
- Getting Started:
installation.md•quickstart.md - Vector Search:
indexing.md•distance-metrics.md•quantization.md - Hybrid Search:
overview.md•multi-vector.md•faceted-search.md - RAG Pipeline:
overview.md•document-processing.md•llm-integration.md - ML Algorithms:
clustering.md•classification.md•regression.md - ML Embeddings:
embedding-generation.md•model-management.md - GPU Support:
cuda-support.md•rocm-support.md•metal-support.md - Operations:
troubleshooting.md•configuration.md•playbook.md
NeuronAgent documentation
- Architecture:
architecture.md - API Reference:
API.md - CLI Guide:
cli_guide.md - Connectors:
connectors.md - Deployment:
deployment.md - Troubleshooting:
troubleshooting.md
NeuronMCP documentation
- Setup Guide:
neurondb-mcp-setup.md - Tool & Resource Catalog:
tool-resource-catalog.md - Examples:
README.md•example-transcript.md
NeuronDesktop documentation
- API Reference:
API.md - Deployment:
deployment.md - Integration:
integration.md - NeuronAgent Usage:
neuronagent_usage.md - NeuronMCP Setup:
neuronmcp_setup.md
| Component | Path | What it is |
|---|---|---|
| NeuronDB | NeuronDB/ |
PostgreSQL extension with vector search, ML algorithms, GPU acceleration (CUDA/ROCm/Metal), embeddings, RAG pipeline, hybrid search, and background workers |
| NeuronAgent | NeuronAgent/ |
Agent runtime + REST/WebSocket API (Go) with multi-agent collaboration, DAG-based workflow engine with human-in-the-loop (HITL), hierarchical memory management, planning & reflection, evaluation framework, budget & cost management, 18+ tools (SQL, HTTP, Code, Shell, Browser, Visualization, Filesystem, Memory, Collaboration, NeuronDB tools, Multimodal, Web Search, Retrieval, Analytics), Prometheus metrics, RBAC, audit logging, and background workers |
| NeuronMCP | NeuronMCP/ |
MCP server for MCP-compatible clients (Go) with 600+ tools (100+ vector operations, complete ML pipeline, RAG operations, 100+ PostgreSQL admin tools, dataset loading, debugging, composition, workflow, plugins), middleware system (validation, logging, timeout, error handling, auth, rate limiting), enterprise features (Prometheus metrics, webhooks, circuit breaker, caching, connection pooling), batch operations, progress tracking, authentication (JWT, API keys, OAuth2), and full MCP protocol support (prompts, sampling/completions, resources) |
| NeuronDesktop | NeuronDesktop/ |
Web UI + API for the ecosystem providing a unified interface |
- Examples index
- Semantic search docs example
- RAG chatbot (PDFs) example
- Agent tools example
- MCP integration example
NeuronDB includes a benchmark suite to evaluate vector search, hybrid search, and RAG performance.
Run all benchmarks:
cd NeuronDB/benchmark
./run_bm.shThis validates connectivity and runs the vector/hybrid/RAG benchmark groups.
| Benchmark | Purpose | Datasets | Metrics |
|---|---|---|---|
| Vector | Vector similarity search performance | SIFT-128, GIST-960, GloVe-100 | QPS, Recall, Latency (avg, p50, p95, p99) |
| Hybrid | Combined vector + full-text search | BEIR (nfcorpus, msmarco, etc.) | NDCG, MAP, Recall, Precision |
| RAG | End-to-end RAG pipeline quality | MTEB, BEIR, RAGAS | Faithfulness, Relevancy, Context Precision |
NeuronDB HNSW index building performance compared to pgvector:
Test Environment:
- PostgreSQL: 18.0
- CPU: Apple Silicon (aarch64-apple-darwin)
- RAM: 256MB
maintenance_work_mem - Index Parameters:
m = 16,ef_construction = 200 - Distance Metric: L2 (Euclidean)
Performance Formula:
The speedup factor is calculated as:
For throughput (vectors per second):
Results:
| Test Case | NeuronDB Optimized | pgvector | Speedup | Throughput (NeuronDB) |
|---|---|---|---|---|
| 50K vectors (128-dim L2) | 606ms (0.606s) ✅ | 6,108ms (6.108s) | 10.1× | 82,508 vec/s |
| 50K vectors (128-dim Cosine) | 583ms (0.583s) ✅ | 5,113ms (5.113s) | 8.8× | 85,763 vec/s |
| 10K vectors (768-dim L2) | 146ms (0.146s) ✅ | 3,960ms (3.960s) | 27.1× | 68,493 vec/s |
| 100K vectors (128-dim L2) | 1,208ms (1.208s) ✅ | 15,696ms (15.696s) | 13.0× | 82,781 vec/s |
Optimizations Applied:
- ✅ In-memory graph building using
maintenance_work_mem - ✅ Efficient neighbor finding during insert (not after flush)
- ✅ SIMD-optimized distance calculations (AVX2/NEON)
- ✅ Squared distance optimization (avoiding
sqrt()overhead) - ✅ Optimized flush with pre-computed neighbors
Benchmark Scripts:
NeuronDB/benchmark/vector/neurondb_vector.sql- NeuronDB optimized HNSW benchmarkNeuronDB/benchmark/vector/pgvector.sql- pgvector reference benchmark
How to Run:
# Create separate databases for fair comparison
psql -d postgres -c "CREATE DATABASE neurondb_bench;"
psql -d postgres -c "CREATE DATABASE pgvector_bench;"
# Run NeuronDB benchmark
psql -d neurondb_bench -f NeuronDB/benchmark/vector/neurondb_vector.sql
# Run pgvector benchmark
psql -d pgvector_bench -f NeuronDB/benchmark/vector/pgvector.sqlNote
Both benchmarks use identical test parameters (same vector generation pattern, same index parameters) to ensure fair comparison. See NeuronDB/benchmark/vector/README.md for detailed benchmark documentation.
To reproduce benchmark results:
# Use exact Docker image tags (see releases)
docker pull ghcr.io/neurondb/neurondb-postgres:v1.0.0-pg17-cpu
# Run with documented hardware profile
cd NeuronDB/benchmark
./run_bm.sh --hardware-profile "cpu-8core-16gb"
# Individual benchmark with exact parameters
cd NeuronDB/benchmark/vector
./run_bm.py --prepare --load --run \
--datasets sift-128-euclidean \
--max-queries 1000 \
--index hnsw \
--ef-search 40Benchmark Results & Hardware Specs
Test Environment:
- CPU: 13th Gen Intel(R) Core(TM) i5-13400F (16 cores)
- RAM: 31.1 GB
- GPU: NVIDIA GeForce RTX 5060, 8151 MiB
- PostgreSQL: 18.1
Vector Search Benchmarks:
| Metric | Value |
|---|---|
| Dataset | sift-128-euclidean |
| Dimensions | 128 |
| Training Vectors | 1,000,000 |
| Test Queries | 10,000 |
| Index Type | HNSW |
| Recall@10 | 1.000 |
| QPS | 1.90 |
| Avg Latency | 525.62 ms |
| p50 Latency | 524.68 ms |
| p95 Latency | 546.62 ms |
| p99 Latency | 555.52 ms |
Hybrid Search Benchmarks:
Status: Not run (see NeuronDB/benchmark/README.md for details)
RAG Pipeline Benchmarks:
Status: Completed (verification passed)
[!NOTE] For detailed benchmark results, reproducible configurations, and additional datasets, see
NeuronDB/benchmark/README.md.
Run individual benchmarks
# Vector benchmark
cd NeuronDB/benchmark/vector
./run_bm.py --prepare --load --run --datasets sift-128-euclidean --max-queries 100
# Hybrid benchmark
cd NeuronDB/benchmark/hybrid
./run_bm.py --prepare --load --run --datasets nfcorpus --model all-MiniLM-L6-v2
# RAG benchmark
cd NeuronDB/benchmark/rag
./run_bm.py --prepare --verify --run --benchmarks mtebThe root docker-compose.yml supports multiple GPU backends via Docker Compose profiles:
Available profiles:
- CPU (default):
docker compose up -dordocker compose --profile cpu up -d - CUDA (NVIDIA):
docker compose --profile cuda up -d - ROCm (AMD):
docker compose --profile rocm up -d - Metal (Apple Silicon):
docker compose --profile metal up -d
Ports differ per profile (see env.example):
- CPU:
POSTGRES_PORT=5433(default) - CUDA:
POSTGRES_CUDA_PORT=5434 - ROCm:
POSTGRES_ROCM_PORT=5435 - Metal:
POSTGRES_METAL_PORT=5436
Example: Start with CUDA support
# Stop CPU services first
docker compose down
# Start CUDA profile
docker compose --profile cuda up -d
# Verify CUDA services are running
docker compose ps
# Connect to CUDA-enabled PostgreSQL
psql "postgresql://neurondb:neurondb@localhost:5434/neurondb" -c "SELECT neurondb.version();"GPU Requirements:
- CUDA: NVIDIA GPU with CUDA 12.2+ and nvidia-container-toolkit
- ROCm: AMD GPU with ROCm 5.7+ and proper device access
- Metal: Apple Silicon (M1/M2/M3) Mac with macOS 13+
Common Docker commands
# Stop everything (keep data volumes)
docker compose down
# Stop everything (delete data volumes - WARNING: deletes all data!)
docker compose down -v
# See status of all services
docker compose ps
# Tail logs for all services
docker compose logs -f
# Tail logs for specific services
docker compose logs -f neurondb neuronagent neuronmcp neurondesk-api neurondesk-frontend
# View last 100 lines of logs
docker compose logs --tail=100
# View logs for specific service
docker compose logs neurondbKey operational considerations for production:
- Vacuum and bloat: Vector indexes require periodic maintenance. See
NeuronDB/docs/operations/playbook.md - Index rebuild guidance: When and how to rebuild HNSW/IVF indexes. See
NeuronDB/docs/troubleshooting.md - Memory configuration: Tune
neurondb.maintenance_work_memand index-specific parameters. SeeNeuronDB/docs/configuration.md
- Contributing:
CONTRIBUTING.md - Security:
SECURITY.md- Report security issues to security@neurondb.ai - License:
LICENSE(proprietary) - Changelog:
CHANGELOG.md- See what's new - Roadmap:
ROADMAP.md- Planned features - Releases:
RELEASE.md- Release process
Stats snapshot (may change)
- 665+ SQL functions in NeuronDB extension
- 52+ ML algorithms supported
- 600+ MCP tools available
- 4 integrated components working together
- 3 PostgreSQL versions supported (16, 17, 18)
- 4 GPU platforms supported (CPU, CUDA, ROCm, Metal)
Platform & version coverage
| Category | Supported Versions |
|---|---|
| PostgreSQL | 16, 17, 18 |
| Go | 1.21, 1.22, 1.23, 1.24 |
| Node.js | 18 LTS, 20 LTS, 22 LTS |
| Operating Systems | Ubuntu 20.04, Ubuntu 22.04, macOS 13 (Ventura), macOS 14 (Sonoma) |
| Architectures | linux/amd64, linux/arm64 |
