Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

add: pgvector vectorstore #140

Merged
merged 3 commits into from
Oct 16, 2024
Merged

add: pgvector vectorstore #140

merged 3 commits into from
Oct 16, 2024

Conversation

iwilltry42
Copy link
Collaborator

@iwilltry42 iwilltry42 commented Oct 15, 2024

Comparison (using the exact same setup, just switching from chromem-go to pgvector - both using the same flow, embedding model and cosine similarity). Only the README.md of knowledge has been ingested. Query:

Top Results

chromem

Setup: default, no changes needed

{
          "id": "eeff81fc-1443-4266-9102-eda0eb532fa1",
          "content": "# GPTScript Knowledge Tool\n## Supported File Types\n- `.pdf`\n- `.html`\n- `.md`\n- `.txt`\n- `.docx`\n- `.odt`\n- `.rtf`\n- `.csv`\n- `.ipynb`\n- `.json`",
          "metadata": {
            "absPath": "/home/thklein/git/github.com/gptscript-ai/knowledge/README.md",
            "filename": "README.md"
          },
          "similarity_score": 0.8255993
        },

pgvector

Setup:

  1. Spin up pgvector locally via docker-compose (compose file provided in repo root): docker compose up
  2. Make knowledge use pgvector: export KNOW_VECTOR_DSN="pgvector://knowledge:knowledge@localhost:5432/knowledge?sslmode=disable"
 {
          "id": "931916aa-a192-4a5a-b54f-908c68453c65",
          "content": "# GPTScript Knowledge Tool\n## Supported File Types\n- `.pdf`\n- `.html`\n- `.md`\n- `.txt`\n- `.docx`\n- `.odt`\n- `.rtf`\n- `.csv`\n- `.ipynb`\n- `.json`",
          "metadata": {
            "absPath": "/home/thklein/git/github.com/gptscript-ai/knowledge/README.md",
            "filename": "README.md"
          },
          "similarity_score": 0.8421717
        },

@iwilltry42 iwilltry42 force-pushed the feat/pgvector branch 3 times, most recently from 71e90e7 to 586f9a7 Compare October 16, 2024 08:33
@iwilltry42 iwilltry42 marked this pull request as ready for review October 16, 2024 08:36
@iwilltry42 iwilltry42 merged commit ae12f51 into main Oct 16, 2024
1 check passed
@iwilltry42 iwilltry42 changed the title add: pgvector add: pgvector vectorstore Oct 16, 2024
@iwilltry42 iwilltry42 deleted the feat/pgvector branch October 16, 2024 08:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant