Skip to content
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

Feat/multiple brains files #361

Merged
merged 26 commits into from
Jun 28, 2023
Merged

Feat/multiple brains files #361

merged 26 commits into from
Jun 28, 2023

Conversation

gozineb
Copy link
Contributor

@gozineb gozineb commented Jun 21, 2023

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Checklist before requesting a review

Please delete options that are not relevant.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented hard-to-understand areas
  • I have ideally added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Screenshots (if appropriate):

@vercel
Copy link

vercel bot commented Jun 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2023 5:36pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 28, 2023 5:36pm

from supabase import Client


class CustomSupabaseVectorStore(SupabaseVectorStore):
"""A custom vector store that uses the match_vectors table instead of the vectors table."""

user_id: str
brain_id: str = "none"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why at none by default ?

--- Create a new primary key with user_id and date
ALTER TABLE users ADD PRIMARY KEY (user_id, date);

-- Delete duplicate rows from the 'users' table
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it idempotent

-- Migration script
BEGIN;

-- Drop the old function if exists
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it idempotent

DROP FUNCTION IF EXISTS match_vectors(VECTOR(1536), INT, TEXT);

-- Create the new function
CREATE OR REPLACE FUNCTION match_vectors(query_embedding VECTOR(1536), match_count INT, p_brain_id UUID)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge all migrations into one
Ask GPT ;)

Copy link
Collaborator

@StanGirard StanGirard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If works on mamadou's computer let me know when we merge so i can run the migrations in prod

@@ -24,8 +24,8 @@ export const NavItems = ({
}: NavItemsProps): JSX.Element => {
const { session } = useSupabase();
const isUserLoggedIn = session?.user !== undefined;
const shouldUseMultipleBrains = useFeature('multiple-brains').on;

const shouldUseMultipleBrains = useFeature("multiple-brains").on;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should may be now remove this ?

@mamadoudicko mamadoudicko requested review from mamadoudicko and removed request for mamadoudicko June 28, 2023 12:52
Copy link
Contributor

@mamadoudicko mamadoudicko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice job !

Will soon be able to share my brain 🤏🏽 with others 😍

Let's rerun the migration in a dev environment one last time.

@gozineb gozineb force-pushed the feat/multiple-brains-files branch from aa63c3d to c5df9c2 Compare June 28, 2023 17:34
@gozineb gozineb changed the title DRAFT: Feat/multiple brains files Feat/multiple brains files Jun 28, 2023
@StanGirard StanGirard merged commit ccdc5bb into main Jun 28, 2023
3 checks passed
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants