fix: Update embedding dimensions to 3072 and add Vercel Analytics

- Updated GOOGLE_EMBEDDING_DIMENSIONS to 3072 to match gemini-embedding-001 output
- Updated database schema embedding index from 768 to 3072 dimensions
- Recreated production database index with correct dimensions
- Added @vercel/analytics package for production analytics
- Added Analytics component to root layout

This fixes the galaxy visualization issue caused by dimension mismatch between
the embedding model output (3072) and the database index (768).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-09 19:00:37 +00:00
parent e4bd3282fd
commit d0978f5f7f
5 changed files with 41 additions and 13 deletions

View File

@@ -68,9 +68,9 @@ DEFINE FIELD coords_3d ON TABLE node TYPE array<number>
-- Define the vector search index.
-- We use MTREE (or HNSW) for high-performance k-NN search.
-- The dimension (768) MUST match the output of the
-- 'text-embedding-004' model.
DEFINE INDEX node_embedding_idx ON TABLE node FIELDS embedding MTREE DIMENSION 768;
-- The dimension (3072) MUST match the output of the
-- 'gemini-embedding-001' model.
DEFINE INDEX node_embedding_idx ON TABLE node FIELDS embedding MTREE DIMENSION 3072;
-- --------------------------------------------------
-- Relation: links_to