Learn R Programming

RAGFlowChainR (version 0.1.1)

create_vectorstore: create_vectorstore.R — Vector-store utilities

Description

Tools to • embed text with the OpenAI API • create a DuckDB-backed vector store (optionally with the `vss` extension) • insert documents with embeddings (handles chunking) • build HNSW/FTS indexes and run nearest-neighbour search

Usage

create_vectorstore(
  db_path = ":memory:",
  overwrite = FALSE,
  embedding_dim = 1536,
  load_vss = identical(Sys.getenv("_R_CHECK_PACKAGE_NAME_"), "")
)

Value

A live `duckdb_connection`. Disconnect manually with `DBI::dbDisconnect(con, shutdown = TRUE)`.

Arguments

db_path

Path to the DuckDB file (\"`:memory:`\" for RAM).

overwrite

If `TRUE`, delete any existing file / table.

embedding_dim

Dimension of the embeddings stored.

load_vss

Try to load the experimental `vss` extension? Defaults to `TRUE` except during CRAN checks where it is forced `FALSE`.

Details

Only `create_vectorstore()` is exported; all other helpers are internal.