FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
janpaul123

janpaul123

semanticSearchBlobs

Remix of janpaul123/jadeMacaw
Public
Like
1
semanticSearchBlobs
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
3
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/29/2024
Viewing readonly version of main branch: v30
View latest version
README.md

Part of Val Town Semantic Search.

Uses Val Town's blob storage to search embeddings of all vals, by downloading them all and iterating through all of them to compute distance. Slow and terrible, but it works!

  • Get metadata from blob storage: allValsBlob${dimensions}EmbeddingsMeta (currently allValsBlob1536EmbeddingsMeta), which has a list of all indexed vals and where their embedding is stored (batchDataIndex points to the blob, and valIndex represents the offset within the blob).
    • The blobs have been generated by janpaul123/indexValsBlobs. It is not run automatically.
  • Get all blobs with embeddings pointed to by the metadata, e.g. allValsBlob1536EmbeddingsData_0 for batchDataIndex 0.
  • Call OpenAI to generate an embedding for the search query.
  • Go through all embeddings and compute cosine similarity with the embedding for the search query.
  • Return list sorted by similarity.

Migrated from folder: semanticSearchPrototype/semanticSearchBlobs

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.