langchain-postgres’s PGVector, providing a unified vector storage service for both Knowledge Base (RAG retrieval) and Memory (long-term memory).
Storage Architecture
Collection Design
| Collection | Purpose | Filter Fields |
|---|---|---|
knowledge | Knowledge base document chunks | user_id, knowledge_base_id, document_id, chunk_index |
memory | User long-term memory | user_id, scope, project_id, session_id |
VectorStore.get_instance(collection_name, embeddings), and the same collection + embeddings combination shares a singleton instance.
Embedding Configuration
Zeus supports user-level embedding configuration, allowing different users to use different embedding models. Configuration is resolved in the following priority order:Priority
| Priority | Source | Resolution Method |
|---|---|---|
| 1 (Highest) | User database config | GET /api/config/embedding (X-User-Id header), selects the config with isDefault=true and enabled=true |
| 2 | Environment variables | OPENAI_API_KEY + OPENAI_BASE_URL + EMBEDDING_MODEL |
| 3 | System default | Next.js API system embedding configuration |
Supported Models
Any model compatible with the OpenAI Embeddings API format can be used:| Model | Description |
|---|---|
text-embedding-3-small | OpenAI default, 1536 dimensions, best cost-performance ratio |
text-embedding-3-large | OpenAI high-precision, 3072 dimensions |
| BGE series | Available via compatible API |
| Jina Embeddings | Available via compatible API |
| Self-hosted models | Accessible via custom base_url |