Step 1: Set up a vector database
Seekr’s Vector Database SDK provides advanced semantic search capabilities by transforming text into vector embeddings, making it possible to perform semantic searches that focus on meaning and context. This approach provides a smarter and more intuitive way to retrieve documents compared to traditional keyword-based methods. First, choose an embedding model: Supported embedding models
Avoid inputs longer than a model’s maximum input tokens.
Bedrock embedding models are available for self-hosted AWS/EKS deployments only. See Use AWS Bedrock for ingestion and inference for setup instructions.
Create an empty vector database
Create the vector database with your chosen model:Step 2: Upload files
Upload your source documents to get thefile_ids for ingestion. Files can be up to 4GB each. For supported file types and file-preparation guidance, see Prepare and ingest files.
Step 3: Start a vector database ingestion job
Next, create a job to ingest documents into your vector database. This step converts the files and creates embeddings from them. Choose an ingestion method and a chunking method, set the chunk size, then start the job.Choose an ingestion method
Accuracy-optimized (default) When you usemethod="accuracy-optimized" or omit the method parameter, the system prioritizes accuracy. Depending on what data is available in your PDF document (bookmarks, tables, text layers), the system combines multiple extraction techniques for best results.
Key features:
- Uses both OCR and direct text extraction, then blends them together
- Employs LLM agents to correct and enhance document hierarchy
- Applies advanced table detection algorithms for accurate table formatting
Documents over 100 pages can take up to 30 minutes to process.
method="speed-optimized", the system balances quality with processing speed. It automatically selects faster methods based on document size while maintaining reasonable accuracy for smaller documents.
Key features:
- Small documents still use high-accuracy methods
- Larger documents use speed optimized algorithms to meet time constraints
Optimized to complete in approximately 3 minutes regardless of document size.
Ingestion mode and the UIWhen ingesting files through the SeekrFlow UI, speed-optimized mode is always used. The SDK lets you choose between speed-optimized and accuracy-optimized.
Choose a chunking method
Setchunking_method to control how SeekrFlow segments content into chunks. The default is markdown; semantic and sliding are also available. See Choose a chunking method for how each method works and how to attach per-chunk metadata.
Set chunk size and overlap
Thetoken_count parameter specifies the target size of each chunk, ensuring each chunk is neither too large (risking truncation by model limits) nor too small (losing semantic coherence).
Best practices:
- Common ranges: For embedding and retrieval, 200–500 tokens per chunk is a widely used range, balancing context and efficiency. The example here uses a token count of 512.
- Adjust for document type: If your documents are dense or have complex structure (e.g., legal, technical), consider slightly larger chunks; for conversational or highly variable content, smaller chunks may work better.
overlap_tokens parameter creates overlapping regions between adjacent chunks at chunk boundaries, reducing the risk of missing relevant information that spans two chunks.
Adjust chunking parameters based on document characteristics:
Create the ingestion job
Attach metadata at ingestion
To attach user-defined metadata to the chunks created by an ingestion job, include an optionalmetadata object in the request. The metadata is job-level: it is copied onto every chunk produced from every file in the job. You can later filter or edit it with the chunk metadata methods (see Manage chunk metadata).
Step 4: Monitor ingestion status (optional)
After starting an ingestion job, you can track job progress, view per-file statuses, and diagnose any failures. See Monitor ingestion for details on checking job states, interpretingfile_records, and resolving errors.
Once status shows completed, your vector database is ready to query. Every ingested chunk also captures provenance metadata (source page, line ranges, heading path) automatically. To trace query results back to their source, see Source tracing.