Connecting...
Read Only

Welcome to VectrixDB

Where vectors come alive

Collections

Browse and manage vector collections

Console

Execute API requests directly

Search

Semantic vector search

Collections

Console

Request Body
Response
// Response will appear here

Tutorials

Get Started with Demo Data

Load demo data to explore all VectrixDB features: semantic search, keyword search, reranking, and knowledge graphs.

Quick Start
5 min

Learn the basics: create a collection, add data, and perform your first search.

Steps:
  1. Click Load Demo above
  2. Go to Collections → click demo
  3. Browse the points to see the data
  4. Go to Search and try all search modes
Semantic Search
Understanding meaning

Find results by meaning, not just keywords. Ask questions in natural language.

Try these queries:
How it works: Text is converted to vectors that capture meaning. Similar concepts cluster together in vector space.
Keyword Search (BM25)
Exact term matching

Traditional search that matches exact words. Great for names, codes, or specific terms.

Try these queries:
How it works: BM25 algorithm ranks documents by term frequency and rarity. Exact matches score highest.
Rerank Search
Dense + Re-ranking

Dense search with cross-encoder re-ranking for improved accuracy.

Try these queries:
How it works: Fast dense retrieval followed by precise re-ranking for better relevance.
Late Interaction
Late interaction

Token-level matching for maximum accuracy. Best for complex queries.

Try these queries:
How it works: Late interaction compares query and document tokens for fine-grained matching.
GraphRAG
Knowledge graph search

Automatically extracts entities and relationships, enabling graph-based retrieval.

Features:
  • Auto entity extraction (People, Places, Concepts)
  • Relationship mapping between entities
  • Graph traversal for connected results
How it works: Uses the configured GraphRAG extractor (R default: regex) to build entity/relationship triples and a searchable knowledge graph.
API Quick Reference
Create Collection
POST /api/collections
{
  "name": "my_docs",
  "dimension": 384,
  "metric": "cosine"
}
Add Texts
POST /api/v2/collections/{name}/add
{
  "texts": ["Your document text"],
  "metadatas": [{"source": "file.pdf"}]
}
Text Search
POST /api/collections/{name}/text-search
{
  "query_text": "your query",
  "limit": 10
}
Keyword Search
POST /api/v1/collections/{name}/keyword-search
{
  "query_text": "query",
  "limit": 10
}

Code Tips

Copy-paste R examples for the VectrixDB R package. Click any code block to copy.

Quick Start (R)

Create a collection, add text, and search in a few lines.

click to copy
library(VectrixDB)

db <- Vectrix$new(
  name = "my_docs",
  path = "./vectrixdb_data",
  tier = "hybrid"
)

db$add(c(
  "R is excellent for data science",
  "VectrixDB provides semantic search in pure R",
  "Hybrid search combines dense and sparse signals"
))

results <- db$search("semantic retrieval", mode = "hybrid", limit = 5)
cat(results$top()$text, "\n")

Add metadata and filter results:

click to copy
library(VectrixDB)

db <- Vectrix$new("products", tier = "hybrid")

db$add(
  texts = c("iPhone 15 Pro", "Galaxy S24", "Pixel 8"),
  metadata = list(
    list(brand = "Apple", price = 999, category = "phone"),
    list(brand = "Samsung", price = 899, category = "phone"),
    list(brand = "Google", price = 699, category = "phone")
  )
)

hits <- db$search(
  query = "premium phone",
  mode = "hybrid",
  filter = list(brand = "Apple"),
  limit = 3
)

print(hits$top())
Tiers and Modes
Collection Tier (set at creation)
dense vector search only
hybrid dense + BM25 + rerank
ultimate hybrid + late interaction
graph ultimate + knowledge graph workflow (regex extractor by default)
Search Mode (set at query time)
dense vector similarity
sparse keyword/BM25
hybrid dense + sparse + rerank
ultimate hybrid + late interaction
Language Behavior (set on collection)
EN English-focused tokenization + English stopword-aware reranking
ML Unicode-aware multilingual tokenization (no forced English stopword stripping)
Graph tip: graph is a collection tier. Query with dense, sparse, hybrid, or ultimate.
click to copy
library(VectrixDB)

# Create collections with different capability tiers
x_dense <- Vectrix$new("docs_dense", tier = "dense")
x_hybrid <- Vectrix$new("docs_hybrid", tier = "hybrid")
x_ultimate <- Vectrix$new("docs_ultimate", tier = "ultimate")
x_graph <- Vectrix$new("docs_graph", tier = "graph")

# Optional: language-aware tokenization profile
x_multi <- Vectrix$new("docs_multi", tier = "hybrid", language = "ml")

# Run different search modes
r_dense <- x_hybrid$search("query", mode = "dense")
r_sparse <- x_hybrid$search("query", mode = "sparse")
r_hybrid <- x_hybrid$search("query", mode = "hybrid")
r_ultimate <- x_ultimate$search("query", mode = "ultimate")
Loading Data in R
From CSV
click to copy
library(VectrixDB)

df <- read.csv("data.csv", stringsAsFactors = FALSE)

meta <- lapply(seq_len(nrow(df)), function(i) {
  list(source = df$source[i], category = df$category[i])
})

db <- Vectrix$new("csv_docs", tier = "hybrid")
db$add(
  texts = df$text,
  ids = as.character(df$id),
  metadata = meta
)
From a folder of markdown files
click to copy
library(VectrixDB)

files <- list.files("docs", pattern = "\\.md$", full.names = TRUE)
texts <- vapply(files, function(f) paste(readLines(f, warn = FALSE), collapse = "\n"), character(1))
meta <- lapply(basename(files), function(nm) list(source = nm, type = "markdown"))

db <- Vectrix$new("md_docs", tier = "hybrid")
db$add(texts = texts, metadata = meta)
Custom Embeddings

Use your own embedding function or bundled word vectors.

click to copy
library(VectrixDB)

my_embed <- function(texts) {
  set.seed(123)
  matrix(runif(length(texts) * 128), nrow = length(texts), ncol = 128)
}

db <- Vectrix$new(
  name = "custom_docs",
  tier = "dense",
  embed_fn = my_embed,
  dimension = 128
)

db$add(c("First document", "Second document"))
db$search("first", mode = "dense")
click to copy
library(VectrixDB)

# Download and use bundled GloVe vectors
vec_path <- download_word_vectors("glove-100")

db <- Vectrix$new(
  name = "glove_docs",
  model_path = vec_path,
  tier = "hybrid"
)
Direct Embedders and GraphRAG
click to copy
library(VectrixDB)

dense <- DenseEmbedder$new(dimension = 384, model_type = "tfidf")
dense_vecs <- dense$embed(c("hello world", "vectrix in r"))

sparse <- SparseEmbedder$new()
sparse_vecs <- sparse$embed(c("keyword search", "bm25 ranking"))

reranker <- RerankerEmbedder$new()
scores <- reranker$score(
  "what is vectrixdb?",
  c("VectrixDB is a vector database", "The sky is blue")
)
click to copy
library(VectrixDB)

cfg <- create_default_graphrag_config(
  search_type = "hybrid",
  extractor = "regex"  # R default extractor
)
pipeline <- create_pipeline(cfg)

pipeline$process(c(
  "Metformin treats type 2 diabetes.",
  "Metformin may have anticancer properties."
))

pipeline$stats()
pipeline$search("metformin", search_type = "local")
Server and API (R)
click to copy
library(VectrixDB)

# Start API + dashboard
vectrix_serve(
  path = "./vectrixdb_data",
  host = "127.0.0.1",
  port = 7377,
  dashboard = TRUE
)

# Or use dashboard helper
vdb_dashboard(data_path = "./vectrixdb_data", port = 7377)
click to copy
# Optional API auth
Sys.setenv(VECTRIXDB_API_KEY = "your-secret-key")

# Start with key enforcement for write endpoints
vectrix_serve(
  path = "./vectrixdb_data",
  port = 7377,
  api_key = Sys.getenv("VECTRIXDB_API_KEY"),
  dashboard = TRUE
)
click to copy
library(httr2)

base_url <- "http://127.0.0.1:7377"

# Create collection
request(paste0(base_url, "/api/collections")) |>
  req_method("POST") |>
  req_body_json(list(name = "api_docs", dimension = 384, metric = "cosine")) |>
  req_perform() |>
  resp_body_json()

# Add text
request(paste0(base_url, "/api/v2/collections/api_docs/add")) |>
  req_method("POST") |>
  req_body_json(list(
    texts = list("First API document"),
    metadatas = list(list(source = "manual"))
  )) |>
  req_perform() |>
  resp_body_json()

# Search
request(paste0(base_url, "/api/collections/api_docs/text-search")) |>
  req_method("POST") |>
  req_body_json(list(query_text = "API document", limit = 5)) |>
  req_perform() |>
  resp_body_json()

# Build / refresh graph entities
request(paste0(base_url, "/api/v1/collections/api_docs/graph/extract")) |>
  req_method("POST") |>
  req_perform() |>
  resp_body_json()

# Force full graph rebuild when needed
request(paste0(base_url, "/api/v1/collections/api_docs/graph/extract?force=true")) |>
  req_method("POST") |>
  req_perform() |>
  resp_body_json()
Create Collection
EN ML
Drop .md files here or click to browse
Auto-chunked by headers and indexed
Authenticate

Enter the server API key to unlock full access. Data is redacted in read-only mode.

Confirm Action