Vector stores enable semantic search and RAG-enhanced extraction for large documents or multi-file processing.Documentation Index
Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
Use this file to discover all available pages before exploring further.
When to Use Vector Stores?
Vector Store Engines
Dex supports two vector store engines. PreferSGP_VECTOR_STORE for new implementations.
| Engine | Best For | Embedding Options | Search Features |
|---|---|---|---|
SGP_VECTOR_STORE | Recommended. Document RAG, advanced search, reranking | Base embedding models | Semantic, lexical, hybrid search; optional reranking |
SGP_KNOWLEDGE_BASE | Legacy only | Base models or Models API deployment | Semantic search |
SGP Vector Store — Recommended
The SGP Vector Store engine is the preferred vector store implementation. Use it for:- Document RAG workflows within Dex
- Lexical (keyword) or hybrid search in addition to semantic search
- Reranking search results for higher relevance
openai/text-embedding-3-large, sentence-transformers/all-mpnet-base-v2).
Search features:
- Query types:
semantic,lexical, orhybrid - Reranking: Optional
rerank_modelandrerank_top_kfor improved result ordering
SGP Knowledge Base — Legacy
The SGP Knowledge Base engine is SGP’s legacy vector store implementation. Its use is discouraged for new projects. Consider it only when:- You need integration with SGP data connectors for ingesting from external sources
- You must use a custom embedding model deployed via the Models API (
embedding_type="models_api") - Your SGP platform does not yet support SGP Vector Store
- Base models (
embedding_type="base"): Use pre-configured embedding models such asopenai/text-embedding-3-large - Models API (
embedding_type="models_api"): Use a custom model deployment viamodel_deployment_id
create_vector_store returns DexSGPKnowledgeBase for SGP_KNOWLEDGE_BASE and DexSGPVectorStore for SGP_VECTOR_STORE. Use DexSGPVectorStore.get_by_id only for SGP Vector Store IDs—it will raise if given a Knowledge Base ID.Creating a Vector Store
Adding Documents to Vector Store
Semantic Search
query_type and reranking for improved results:
Custom Metadata Schema
You can define custom metadata fields on your vector store and attach metadata to each parse result. This metadata is indexed and filterable when searching, so you can narrow results by document attributes such as department, document type, or priority. 1. Define the schema when creating the vector store Specifyvector_store_metadata_schema as a dict mapping field names to types: "string", "int", "double", or "boolean".
vector_store_metadata in your parse job parameters. The metadata is stored with the parse result and indexed when you add it to the vector store.
vector_store_metadata when creating the parse result via DexParseResult.from_custom_results.
3. Filter on custom metadata when searching
Use the filters parameter in search. Filter format depends on the engine:
| Operation | SGP Vector Store | SGP Knowledge Base | Example |
|---|---|---|---|
| Equal | $eq | eq | {"department": {"$eq": "legal"}} |
| Not equal | $ne | ne | {"department": {"$ne": "archived"}} |
| Greater than | $gt | gt | {"priority": {"$gt": 1}} |
| Greater than or equal | $gte | gte | {"priority": {"$gte": 1}} |
| Less than | $lt | lt | {"priority": {"$lt": 5}} |
| Less than or equal | $lte | lte | {"priority": {"$lte": 5}} |
| In (list of values) | $in | in | {"department": {"$in": ["legal", "finance"]}} |
| Not in (list of values) | $nin | nin | {"department": {"$nin": ["archived"]}} |
| And (combine conditions) | $and | and | {"$and": [{"department": {"$eq": "legal"}}, {"priority": {"$gte": 1}}]} |
| Or (any condition matches) | $or | or | {"$or": [{"department": {"$eq": "legal"}}, {"department": {"$eq": "finance"}}]} |
| Not (negate condition) | $not | not | {"department": {"$not": {"$eq": "archived"}}} |
The schema must be defined when creating the vector store. Fields in
vector_store_metadata that are not in vector_store_metadata_schema are not indexed and cannot be used for filtering.RAG-Enhanced Extraction
Extract data using vector store context for improved accuracy on large documents:Pattern: RAG for Large Documents
Next Steps
- Extract: Extract structured data from parse results or vector stores
- Chunking: Optimize chunking for vector store embeddings
- API Reference: Complete SDK documentation

