New package: @chatcops/store-upstash-vector

Fechada
#362 2 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 1 dia

@srujankaleru2007 já está trabalhando nisso.

Desde 27/10/2026.

  • #385 de @srujankaleru2007 — aberto

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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
Linguagem predominante
TypeScript
Estrelas
13
Forks
7
Merge médio
3h 11min
PRs com merge (30d)
330

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de codercops/chatcops

Todas as issues de codercops/chatcops

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.