-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(docs): added vector search #2583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryReplaced fumadocs client-side search with a hybrid vector + keyword search system using PostgreSQL and OpenAI embeddings. Vector search (cosine similarity with pgvector) is enabled for English queries, while all languages get keyword search using PostgreSQL full-text search with locale-specific text search configurations. Results are interleaved to combine semantic and lexical matching. Key Changes:
Notes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant SearchAPI as GET /api/search
participant OpenAI as OpenAI API
participant DB as PostgreSQL
Client->>SearchAPI: "GET ?query=...&locale=...&limit=10"
alt Empty query
SearchAPI->>Client: "Empty array"
end
SearchAPI->>SearchAPI: "Parse params"
SearchAPI->>SearchAPI: "Compute tsConfig from locale"
alt locale is en
SearchAPI->>OpenAI: "POST /v1/embeddings"
OpenAI->>SearchAPI: "embedding vector (1536 dims)"
SearchAPI->>DB: "Vector search (cosine similarity)"
DB->>SearchAPI: "vectorResults"
end
SearchAPI->>DB: "Keyword search (ts_rank)"
DB->>SearchAPI: "keywordResults"
SearchAPI->>SearchAPI: "Interleave & deduplicate"
SearchAPI->>SearchAPI: "Map to format"
SearchAPI->>Client: "JSON search results"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 2 comments
a4ca7f2 to
14f6648
Compare
Summary
Type of Change
Testing
Tested manually
Checklist