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

[Go] pgvector sample #375

Merged
merged 1 commit into from
Jun 10, 2024
Merged

[Go] pgvector sample #375

merged 1 commit into from
Jun 10, 2024

Conversation

jba
Copy link
Contributor

@jba jba commented Jun 10, 2024

A sample demonstrating how to use Postgres's vector extension
to build an indexer and retriever.

A sample demonstrating how to use Postgres's vector extension
to build an indexer and retriever.
for _, doc := range res.Documents {
fmt.Printf("%+v %q\n", doc.Metadata, doc.Content[0].Text)
}
// Use documents in RAG prompts.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a TODO? I'm not sure what the point of retrieving here is, as you don't actually answer the question asked.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's deliberately a sketch. So yeah it's a TODO, but not for us, for whoever copies the sample.

I based it off of https://github.com/firebase/genkit/blob/main/docs/templates/pgvector.md.
I decided to write actual code rather than a markdown file so I could be sure it actually worked.

@ianlancetaylor
Copy link
Contributor

Are we not going to add this as a plugin?

@jba
Copy link
Contributor Author

jba commented Jun 10, 2024

We are not going to make a plugin, presumably because the sql is very specific to a particular application.

See https://github.com/firebase/genkit/blob/main/docs/templates/pgvector.md for the equivalent JS.

@jba jba merged commit c828f5f into jba-googleai-init Jun 10, 2024
5 checks passed
@jba jba deleted the jba-pgvector branch June 10, 2024 21:05
jba added a commit that referenced this pull request Jul 11, 2024
A sample demonstrating how to use Postgres's vector extension
to build an indexer and retriever.

Formerly #375.
@jba jba mentioned this pull request Jul 11, 2024
jba added a commit that referenced this pull request Jul 11, 2024
A sample demonstrating how to use Postgres's vector extension
to build an indexer and retriever.

Formerly #375.
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.

3 participants