Vector Databases
Vector databases are the foundation of Retrieval-Augmented Generation (RAG) in Karyam.
They store numerical representations of enterprise knowledge, allowing AI systems to retrieve information based on meaning rather than exact keywords.
Without vector databases, AI systems cannot efficiently search and reason over organizational knowledge.
Why Traditional Databases Are Not Enough
Section titled “Why Traditional Databases Are Not Enough”Traditional databases excel at exact matching.
For example:
SELECT * FROM documentsWHERE title = 'VPN Policy'This works well when you know exactly what you’re looking for.
However, employees rarely ask questions this way.
Instead they ask:
My VPN access expired. Can you restore it?
The document may never contain the phrase:
VPN access expired
Instead it may contain:
VPN credentials must be renewed every 90 days.
Keyword search struggles here.
Semantic search understands that both statements refer to the same concept.
What Is a Vector?
Section titled “What Is a Vector?”Embedding models convert text into numerical representations called vectors.
Example:
"VPN credentials expire after 90 days"
↓
[0.12, -0.45, 0.81, 0.03, ...]Documents with similar meaning produce vectors that are close together in vector space.
This allows AI systems to search by meaning rather than exact wording.
How Vector Search Works
Section titled “How Vector Search Works”Employee Question ↓Embedding Model ↓Query Vector ↓Vector Similarity Search ↓Relevant Chunks Retrieved ↓Context Sent To AgentThe AI model never searches documents directly.
Instead it searches embeddings stored in the vector database.
Karyam Architecture
Section titled “Karyam Architecture”In Karyam, vector databases are one component of the retrieval pipeline:
Files ↓Embedding Listener ↓Chunking ↓Embedding Model ↓Vector Database ↓Retrieval ↓AgentThis architecture provides:
- Flexible storage providers
- Multiple embedding models
- Event-driven ingestion
- Retrieval observability
- Enterprise scalability
Supported Providers
Section titled “Supported Providers”Karyam currently supports:
Qdrant
Section titled “Qdrant”Purpose-built vector database optimized for semantic search workloads.
Best for:
- Dedicated RAG infrastructure
- Large-scale deployments
- High retrieval throughput
- Multi-tenant environments
Advantages:
- Native vector indexing
- High performance similarity search
- Rich filtering capabilities
- Horizontal scalability
PGVector
Section titled “PGVector”PostgreSQL extension that adds vector search capabilities.
Best for:
- Existing PostgreSQL environments
- Smaller deployments
- Simpler infrastructure management
- On-premises installations
Advantages:
- Reuse existing PostgreSQL infrastructure
- SQL-based filtering
- Simplified operations
- Lower infrastructure complexity
Choosing a Provider
Section titled “Choosing a Provider”| Requirement | Recommended Provider |
|---|---|
| Maximum performance | Qdrant |
| Existing PostgreSQL environment | PGVector |
| Large enterprise deployment | Qdrant |
| Small team deployment | PGVector |
| Simplified operations | PGVector |
| High-scale retrieval | Qdrant |
Storage Model in Karyam
Section titled “Storage Model in Karyam”Each vector database contains:
- Embeddings
- Chunk metadata
- Source file references
- Workspace isolation information
Example:
Vector Database│├── Chunk│ ├── Content│ ├── Embedding│ ├── File Path│ ├── Metadata│ └── Workspace UUID│├── Chunk│└── ChunkThis enables:
- Multi-tenant environments
- File-level traceability
- Source attribution
- Retrieval debugging
Vector Dimensions
Section titled “Vector Dimensions”The size of an embedding vector depends on the embedding model used.
Examples:
| Model | Dimensions |
|---|---|
| gemini-embedding-2 | 3072 |
| voyage-multimodal-3.5 | 1024 |
| qwen3-embedding:8b | 4096 |
Vector databases must support the embedding dimensions produced by the configured embedding model.
Metadata Filtering
Section titled “Metadata Filtering”Karyam supports metadata-aware retrieval.
Examples:
Only search:
- HR documents- Finance policies- Workspace A- Files uploaded after July 2026This improves retrieval accuracy and reduces irrelevant context.
Observability
Section titled “Observability”Every interaction with the vector database is observable through:
- RAG Runs
- Retrieval Logs
- Chunk Metadata
- Source Attribution
This makes semantic retrieval debuggable in production environments.
Example Retrieval Flow
Section titled “Example Retrieval Flow”Employee:"My VPN access expired."
Agent:↓Generate Query Embedding↓Search Vector Database↓Retrieve VPN Policy Chunks↓Generate ResponseRetrieved context:
VPN credentials expire every 90 days and require manager approval for renewal.The agent can now answer using company policy rather than model assumptions.
Best Practices
Section titled “Best Practices”Use Dedicated Databases For Large Domains
Section titled “Use Dedicated Databases For Large Domains”Example:
HR DatabaseFinance DatabaseEngineering DatabaseLegal DatabaseKeep Embedding Dimensions Consistent
Section titled “Keep Embedding Dimensions Consistent”Changing embedding dimensions requires rebuilding vector storage.
Choose embedding models carefully.
Use Metadata
Section titled “Use Metadata”Metadata improves retrieval quality and observability.
Always preserve:
- File paths
- Categories
- Workspace identifiers
- Source information
Monitor Retrieval Quality
Section titled “Monitor Retrieval Quality”Poor retrieval quality usually originates from:
- Incorrect chunking
- Weak embedding models
- Missing metadata
- Oversized documents
RAG Runs help identify these issues quickly.
Next Steps
Section titled “Next Steps”Now that you understand vector storage, continue with:
➡️ Embeddings
Learn how embedding models convert enterprise knowledge into vectors that can be searched semantically.
