Skip to content
Karyam

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.


Traditional databases excel at exact matching.

For example:

SELECT * FROM documents
WHERE 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.


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.


Employee Question
↓
Embedding Model
↓
Query Vector
↓
Vector Similarity Search
↓
Relevant Chunks Retrieved
↓
Context Sent To Agent

The AI model never searches documents directly.

Instead it searches embeddings stored in the vector database.


In Karyam, vector databases are one component of the retrieval pipeline:

Files
↓
Embedding Listener
↓
Chunking
↓
Embedding Model
↓
Vector Database
↓
Retrieval
↓
Agent

This architecture provides:

  • Flexible storage providers
  • Multiple embedding models
  • Event-driven ingestion
  • Retrieval observability
  • Enterprise scalability

Karyam currently supports:

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

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

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

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
│
└── Chunk

This enables:

  • Multi-tenant environments
  • File-level traceability
  • Source attribution
  • Retrieval debugging

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.


Karyam supports metadata-aware retrieval.

Examples:

Only search:
- HR documents
- Finance policies
- Workspace A
- Files uploaded after July 2026

This improves retrieval accuracy and reduces irrelevant context.


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.


Employee:
"My VPN access expired."
Agent:
↓
Generate Query Embedding
↓
Search Vector Database
↓
Retrieve VPN Policy Chunks
↓
Generate Response

Retrieved 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.


Example:

HR Database
Finance Database
Engineering Database
Legal Database

Changing embedding dimensions requires rebuilding vector storage.

Choose embedding models carefully.


Metadata improves retrieval quality and observability.

Always preserve:

  • File paths
  • Categories
  • Workspace identifiers
  • Source information

Poor retrieval quality usually originates from:

  • Incorrect chunking
  • Weak embedding models
  • Missing metadata
  • Oversized documents

RAG Runs help identify these issues quickly.


Now that you understand vector storage, continue with:

➡️ Embeddings

Learn how embedding models convert enterprise knowledge into vectors that can be searched semantically.