Welcome to VectrixDB
Where vectors come alive
Collections
Browse and manage vector collections
Console
Execute API requests directly
Search
Semantic vector search
Collections
Console
// Response will appear here
Collection
| ID | Metadata | Vector | |
|---|---|---|---|
| Select a collection to browse points | |||
Tutorials
Get Started with Demo Data
Load demo data to explore all VectrixDB features: semantic search, keyword search, reranking, and knowledge graphs.
Learn the basics: create a collection, add data, and perform your first search.
- Click Load Demo above
- Go to Collections → click
demo - Browse the points to see the data
- Go to Search and try all search modes
Find results by meaning, not just keywords. Ask questions in natural language.
Traditional search that matches exact words. Great for names, codes, or specific terms.
Dense search with cross-encoder re-ranking for improved accuracy.
Token-level matching for maximum accuracy. Best for complex queries.
Automatically extracts entities and relationships, enabling graph-based retrieval.
- Auto entity extraction (People, Places, Concepts)
- Relationship mapping between entities
- Graph traversal for connected results
POST /api/collections
{
"name": "my_docs",
"dimension": 384,
"metric": "cosine"
}
POST /api/v2/collections/{name}/add
{
"texts": ["Your document text"],
"metadatas": [{"source": "file.pdf"}]
}
POST /api/collections/{name}/text-search
{
"query_text": "your query",
"limit": 10
}
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.
Create a collection, add text, and search in a few lines.
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:
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())
dense vector similaritysparse keyword/BM25hybrid dense + sparse + rerankultimate hybrid + late interactionEN English-focused tokenization + English stopword-aware rerankingML Unicode-aware multilingual tokenization (no forced English stopword stripping)graph is a collection tier. Query with dense, sparse, hybrid, or ultimate.
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")
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
)
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)
Use your own embedding function or bundled word vectors.
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")
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"
)
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")
)
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")
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)
# 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
)
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()