-
Notifications
You must be signed in to change notification settings - Fork 49
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
✨ Add knowledge retrieval by using RAG #805
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CI Feedback 🧐(Feedback updated until commit 81ac3b5)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
@@ -0,0 +1,80 @@ | |||
create extension if not exists "vector" with schema "public" version '0.8.0'; |
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.
📝 Use template for LangChain from Quick Start.
see: https://supabase.com/docs/guides/ai/langchain#initializing-your-database
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
chunkCount: number | ||
} | ||
|
||
export async function vectorizeUrl(url: string): Promise<VectorizationResult> { |
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.
📝 HTML -> text -> chunked text -> embedding
ref: https://speakerdeck.com/atsushii/langchaintosupabasewohuo-yong-site-ragwoshi-zhuang-sitemita?slide=19
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.
LGTM 👍🏻 Cool!!
const embeddings = new OpenAIEmbeddings({ | ||
modelName: 'text-embedding-3-small', | ||
}) | ||
|
||
export const vectorStore = new SupabaseVectorStore(embeddings, { | ||
client: supabaseClient, | ||
tableName: 'documents', | ||
queryName: 'match_documents', | ||
}) |
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.
📝 if we use other Models, It may be necessary to have a corresponding embeddings model and vectorStore for each.
Relevant Context: | ||
""" | ||
{context} | ||
""" |
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.
I see 👀
2025-03-04.18.47.26.mov
Issue
Why is this change needed?
What would you like reviewers to focus on?
Testing Verification
What was done
🤖 Generated by PR Agent at 81ac3b5
KnowledgeRetrievalWindow
component for user queries and AI responses.TextVectorizer
andUrlVectorizer
components.documents
table with vector embeddings.Header
component.Detailed Changes
12 files
Add Knowledge Retrieval Window component
Add URL Vectorizer component
Implement retrieval API for knowledge queries
Add Text Vectorizer component
Add vectorization logic for text and URLs
Implement vectorization API for text and URLs
Add responsive header with navigation
Update layout to include Header component
Add Vectorize page with text and URL vectorization
Add Knowledge Retrieval page
Configure vector store with Supabase
Export vectorization and Supabase utilities
4 files
Add Supabase client configuration
Add Supabase migration for documents table and vector functions
Add Supabase environment variables
Exclude migration-web from workspace packages
7 files
Add styles for Knowledge Retrieval Window
Add styles for Text Vectorizer component
Add styles for URL Vectorizer component
Add styles for Header component
Update global styles for layout and main content
Add styles for Knowledge Retrieval page
Add styles for Vectorize page
2 files
Approve new dependencies and licenses
Update dependencies and Supabase CLI commands
1 files
Additional Notes