Repository navigation
Closed as not planned
Labels
featNew featureneeds discussionRequires team discussion before implementationpriority: mediumMedium priorityservice: platformPlatform service
Description
Problem Statement
Currently crawled web pages are stored in the websitePages table but are not effectively utilized for semantic search. The existing RAG implementation relies on an external service (Cognee + PGVector), which adds system complexity.
Requirements
- Maintain vector tables natively within Convex
- Users should only need to configure environment variables, not modify schema.ts
- Support different embedding model dimensions
- No migration of existing data required
Current State
Data Storage:
websitePagestable stores crawled content (url, title, content, metadata)
Existing RAG Architecture:
- External RAG service: Cognee + PGVector (localhost:8001)
- Sync workflow:
website_pages_rag_sync
Proposed Solution
Pre-defined Multi-dimension Vector Tables: Define multiple vector tables with different dimensions in the schema. Users select which one to use via the EMBEDDING_DIMENSIONS environment variable.
Supported Dimensions
| Dimension | Table Name | Suitable Model |
|---|---|---|
| 256 | websitePageEmbeddings256 |
text-embedding-3-small (reduced) |
| 512 | websitePageEmbeddings512 |
text-embedding-3-small (reduced) |
| 1024 | websitePageEmbeddings1024 |
text-embedding-3-small (reduced) |
| 1536 | websitePageEmbeddings1536 |
text-embedding-3-small (default) |
| 2048 | websitePageEmbeddings2048 |
Convex maximum supported |
Note: Convex vectorIndex supports a maximum of 2048 dimensions
Affected Components
-
convex/schema.ts- Add 5 multi-dimension embedding tables -
convex/lib/embedding_config.ts- New dimension configuration utilities -
convex/website_page_embeddings.ts- New embedding generation and search logic -
convex/agent_tools/website_pages/website_pages_search_tool.ts- New Agent search tool -
convex/agent_tools/tool_registry.ts- Register new tool -
convex/model/websites/bulk_upsert_pages.ts- Auto-trigger embedding generation -
.env.example- Add EMBEDDING_DIMENSIONS documentation
Acceptance Criteria
- 5 multi-dimension embedding tables created successfully
-
EMBEDDING_DIMENSIONSenv var correctly switches the active table - Newly crawled pages automatically generate embeddings
- Semantic search returns relevant results
- Agent can search via
website_pages_searchtool - Search supports filtering by organizationId and websiteId
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
featNew featureneeds discussionRequires team discussion before implementationpriority: mediumMedium priorityservice: platformPlatform service
Activity
larryro commentedon Jan 4, 2026
Implementation Plan
Phase 1: Schema Definition
1.1 Create multi-dimension embedding tables
Add to
convex/schema.ts:Phase 2: Dimension Configuration Layer
2.1 Create configuration utilities
New file:
convex/lib/embedding_config.tsSUPPORTED_DIMENSIONSconstantgetEmbeddingDimension()- reads from env vargetEmbeddingTableName()- returns table namegetRecommendedEmbeddingModel()- model selection based on dimensionPhase 3: Embedding Generation
3.1 Create embedding action
New file:
convex/website_page_embeddings.tsgenerateEmbedding- internal action to generate and store embeddinggetByPageId- query existing embeddingupsert- create or update embedding recordPhase 4: Vector Search
4.1 Create search action
Add to
convex/website_page_embeddings.ts:searchaction - performs vector searchPhase 5: Agent Tool Integration
5.1 Create search tool
New file:
convex/agent_tools/website_pages/website_pages_search_tool.tswebsite_pages_searchtool definition5.2 Register tool
Update
convex/agent_tools/tool_registry.tsPhase 6: Auto-sync Trigger
6.1 Trigger embedding on page save
Update
convex/model/websites/bulk_upsert_pages.ts:Files to Modify
convex/schema.tsconvex/lib/embedding_config.tsconvex/website_page_embeddings.tsconvex/agent_tools/website_pages/website_pages_search_tool.tsconvex/agent_tools/tool_registry.tsconvex/model/websites/bulk_upsert_pages.ts.env.exampleEnvironment Variable Configuration
Potential Risks
EMBEDDING_DIMENSIONSwrites to a different table; old data won't migrate automaticallyTesting Strategy
🤖 Generated with Claude Code
yannickmonney commentedon May 31, 2026
Triaged — keeping open, but flagging for design review. Semantic search currently goes through the external RAG service (
services/rag/); thewebsitePagestable + awebsite_pages_rag_syncflow already exist. Adding native Convex vector search forwebsitePagesis a meaningful architectural choice that competes with the external-RAG direction (cf. #662, #69), so it's worth a design decision on which path to invest in before building. Assigned to me.larryro commentedon Jun 1, 2026
Closing this in favor of the external RAG direction — the design question is already settled by prior experience.
We tried native Convex vector search for this kind of workload before, and it doesn't hold up. Storing embeddings + running a
vectorIndexover them at our scale pushes the deployment into failure modes that affect everything, not just search:Those are deployment-wide outages, not isolated search degradation, so the risk far outweighs the benefit of dropping the external service. Semantic search already works through
services/rag/(Cognee + PGVector) plus thewebsite_pages_rag_syncflow, so there's no functional gap to close here.Staying on external RAG (cf. #662, #69). Closing as not planned.