PgVectorKnowledgeBase is a PostgreSQL-backed vector knowledge base. It uses the pgvector extension for similarity search.
Import it from the connector submodule. There is no trusttest.kb package and no PostgresKnowledgeBase class.
Installation
Constructor
Default
fields_mapping is {"id": "id", "content": "content", "embeddings": "embedding"}.
Example
trusttest.set_config({"embeddings": {"provider": "openai", "model": "text-embedding-3-small"}}) if you omit embeddings_model.
Notes
- Enable the extension:
CREATE EXTENSION IF NOT EXISTS vector; - If the embeddings column is missing, semantic search is disabled.