New package: @chatcops/store-upstash-vector

Chiusa
#362 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@srujankaleru2007 ci sta già lavorando.

Dal 27/10/2026.

  • #385 di @srujankaleru2007 — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

enhancement hacktoberfest help wanted

@chatcops/core now has a VectorStore interface (#333). This adds a new package with a VectorStore backed by Upstash Vector, for serverless sites (Vercel, Netlify) that already use Upstash Redis through @chatcops/store-redis.

What every vector store needs

  • Implement VectorStore from @chatcops/core (packages/core/src/storage/types.ts): dimensions, upsert, query (cosine similarity, best first), deleteBySource, and keywordQuery where the backend has full-text search.
  • Expose it as vectors on the storage the package already returns, so runStorageConformance picks it up. Its vector section (in packages/core/src/testing/conformance.ts) is the spec: run it from the package's tests/conformance.test.ts, with at least 4 dimensions.
  • Filters follow MetadataFilter: every key must match, a value matches only the same type (1 is not "1"), an array means any of its values, and a record without the key never matches.
  • memoryVectors (packages/core/src/storage/memory-vectors.ts) is the reference implementation, and segmentWords there splits text into words with Intl.Segmenter (use it so Japanese and Chinese keyword search works).
  • Add a short section for your store under "Vector stores" in website/src/content/docs/server/storage.mdx, and a changeset for the package (minor).

For this package

  • Start from packages/store-redis for the layout: package.json ("private": true for now, @upstash/vector as a peer dependency), tsconfig.json, vitest.config.ts, README.md, CHANGELOG.md. The root vitest.config.ts and pnpm-workspace.yaml pick up new packages under packages/ on their own.
  • Export upstashVectors({ index, dimensions }) returning a VectorStore, where index is an @upstash/vector Index.
  • Upstash filters are a string syntax (locale = 'de' AND collection IN ('docs', 'pricing')). Build it from MetadataFilter with proper quoting, so a value can't change the filter.
  • keywordQuery only if the index type supports full-text (hybrid or sparse indexes). Otherwise leave it out.
  • There's no local Upstash Vector emulator, so: unit tests with a fake Index for the logic (filter building, mapping, deletes), and the conformance suite gated on CHATCOPS_TEST_UPSTASH_VECTOR_URL and CHATCOPS_TEST_UPSTASH_VECTOR_TOKEN, skipped without them. Upstash has a free tier if you'd like to run it yourself.

Acceptance criteria

  • New package builds, type-checks and passes its tests in CI
  • Conformance passes against a real index when the env variables are set (say in the PR whether you ran it)
  • Filter strings are quoted safely, with a test for a value containing a quote
  • README, a docs section and a changeset
  • pnpm test:coverage and pnpm lint pass
Lingua principale
TypeScript
Stelle
13
Fork
7
Merge medio
3h 11m
PR unite (30g)
330

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codercops/chatcops

Tutte le issue di codercops/chatcops

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.