feat: add RAG-powered analysis with local vector store#647
Closed
Yigtwxx wants to merge 1 commit into
Closed
Conversation
|
@Yigtwxx is attempting to deploy a commit to the Elie Team on Vercel. A member of the Team first needs to authorize it. |
- Add IndexedDB-backed vector store (src/services/vector-store.ts) with cosine similarity search, TTL-based pruning, and quota error handling - Vectorize RSS headlines in background via ML worker embeddings - Enrich country intel briefs with historical context from local vector store - Add optional geoContext field to GetCountryIntelBriefRequest proto - Update generated client/server stubs for new proto field - Add e2e test for vector store CRUD and similarity search - Add e2e/tsconfig.json extending root config - Fix cross-boundary import: move hashString to src/utils/hash.ts - Fix e2e test: correct IndexedDB name in beforeEach cleanup
Yigtwxx
force-pushed
the
feat/rag-powered-analysis
branch
from
March 1, 2026 09:23
d0ca697 to
7e8966a
Compare
7 tasks
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added a client-side RAG (Retrieval-Augmented Generation) pipeline that gives country intelligence briefs historical context from previously seen headlines. Here's the flow:
The new
vector-store.tsmodule handles all the IndexedDB operations — cosine similarity search, TTL-based pruning, and storage quota error handling.On the client side,
country-intel.tsnow enriches the existingbuildBriefContextSnapshotoutput with RAG-retrieved historical events before passing it tofetchCountryIntelBrief. The RAG context flows through the existing context query param, so no proto or server changes were needed.Also caught and fixed two issues during review:
beforeEach(wm-vector-storeinstead ofworldmonitor_vector_store)rss.tswas importinghashStringfromserver/_shared/hash, which was the only cross-boundary import in the entiresrc/tree — moved it tosrc/utils/hash.tsType of change
Affected areas
Checklist
api/rss-proxy.jsallowlist (if adding feeds)npm run typecheck)Screenshots
No UI changes — this is a data pipeline addition.