Skip to content
Open source · v0.24.0 · MIT

Vector search that lives inside your app.

Keep vectors, text, metadata, and indexes beside your Go code. VecLite gives you HNSW, BM25, hybrid ranking, and an optional crash-safe WAL in one embeddable database—without another service to deploy.

  • Portable snapshot file
  • Standard-library storage and search core
  • Go, CLI, HTTP, and MCP
vectors.veclite/docs
local process
crash-safe writes after a restart⌘ K
HNSWvector
BM25text
RRFmerge
Ranked resultsHNSW + BM25 fused with RRF
  1. 01guide/durability.mdvector + exact terms0.0328
  2. 02wal.gosemantic match0.0317
  3. 03guide/go-client.mdkeyword match0.0161
Portable snapshotOne database file to move, inspect, and back up
HNSW + BM25Semantic and exact retrieval in one collection
Four access pathsEmbedded Go, CLI, HTTP, and MCP
WAL recoveryOptional crash-safe writes with automatic replay
A working result, first

From import to nearest match in one file.

Start in memory, point the same code at a file when you want persistence, and add HNSW, BM25, filters, or a WAL only when the workload calls for them.

  1. 01
    OpenUse :memory: or a database path.
  2. 02
    InsertKeep vectors and payload data together.
  3. 03
    SearchReturn records, not detached vector IDs.
main.go
package main

import (
    "fmt"
    "log"

    "github.com/abdul-hamid-achik/veclite"
)

func main() {
    db, err := veclite.Open(":memory:") // or "search.veclite"
    if err != nil {
        log.Fatal(err)
    }
    defer db.Close()

    docs := db.Collection("docs")
    _, err = docs.Insert(
        []float32{0.1, 0.2, 0.3, 0.4},
        map[string]any{"file": "README.md"},
    )
    if err != nil {
        log.Fatal(err)
    }

    results, err := docs.Search(
        []float32{0.15, 0.25, 0.35, 0.45},
        veclite.TopK(1),
    )
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(results[0].Record.Payload["file"])
}
Runs in-process with no server
One retrieval engine

One record. Every useful way to find it.

Store the source text, payload, and multiple embeddings together. Query by meaning, exact language, metadata, or all three—then return the same logical record instead of reconciling separate systems.

Ranking pipeline

Semantic when it helps. Exact when it matters.

Search HNSW vectors, BM25 text, and payload filters independently—or fuse them with Reciprocal Rank Fusion for resilient hybrid retrieval.

Choose a search mode
record / 1042Crash-safe writes with WAL replay
vectorcontentpayload
HNSW BM25 Filters
fused resultguide/durability.mdrank 01
Named vector spaces

Multimodal without duplicated records.

Give one item text, image, or audio embeddings. Each space keeps its own dimension, metric, profile, and optional HNSW index.

Model multimodal data
Persistence

Portable by default. Crash-safe when you need it.

Atomic snapshots keep the database easy to move. Enable the optional WAL to fsync completed mutations, replay after a crash, and checkpoint automatically.

Pick a durability mode
Embedding profiles

Catch model drift before it corrupts retrieval.

Persist provider, model, dimension, distance, normalization, and version. Compatibility checks tell your app when an index needs a rebuild.

ollama / nomic-embed-text
768d · cosine · normalized
version: chunker-v2
Design an embedding strategy
Agent memory toolkit

Retrieval is the start of memory, not the end.

VecLite adds explicit APIs for the lifecycle around retrieval: recency, importance, conversations, episodes, consolidation, notifications, and relationships. Your application decides when each policy runs.

Shape time

Set TTLs and importance, start background cleanup when you want it, and apply temporal decay to vector retrieval.

Keep conversation context

Store session turns, parent-child threads, roles, and turn order beside the vectors that retrieve them.

Organize long memory

Caller-driven consolidation and episode APIs help group related records while preserving the originals.

Connect and react

Subscriptions notify on matching inserts, while the knowledge graph adds typed entities, edges, and traversal.

Design an agent memory store
session / incident-423 turns
U
user · turn 01

Why did the write survive the restart?

T
tool · search

Matched the WAL recovery guide and replay code.

A
assistant · turn 03

The completed mutation was replayed over the last snapshot.

retrieved memory#1042

WAL replay restores completed mutations after an interrupted writer.

importance0.88expires23haccesses12
Keep search close

Put the index beside the code that understands it.

Start with a four-dimensional demo today. Grow into HNSW, hybrid ranking, named spaces, durable writes, and agent memory without changing databases.