Skip to main content
memvid-core exposes structured request/response types for retrieval:
  • Memvid::search(SearchRequest) performs lexical retrieval and returns a SearchResponse with the selected engine
  • Memvid::ask(AskRequest, Option<&impl VecEmbedder>) runs retrieval + optional synthesis (set context_only: true to only fetch context)
  • Memvid::vec_search_with_embedding(...) performs pure vector search when you already have a query embedding (and validates dimensions)
search() and ask() require the lex crate feature (enabled by default). For semantic-only or hybrid ranking, pass a VecEmbedder implementation (or use vec_search_with_embedding with a precomputed query vector).

Permission-Aware Retrieval (ACL)

Use acl_context + acl_enforcement_mode to enforce tenant isolation and RBAC at retrieval time. See Permission-Aware Retrieval (ACL).
Tip: If you want to plug in an LLM, use AskResponse.retrieval.context as the prompt context and keep context_only: true in the core call.