Defines Pydantic models for Ivfflat and HNSW index configurations in PostgreSQL vector databases. Reuse when setting up vector similarity search.
# Source: https://github.com/CopilotKit/agno | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from typing import Any, Dict, Optional
from pydantic import BaseModel
class Ivfflat(BaseModel):
name: Optional[str] = None
lists: int = 100
probes: int = 10
dynamic_lists: bool = True
configuration: Dict[str, Any] = {
"maintenance_work_mem": "2GB",
}
class HNSW(BaseModel):
name: Optional[str] = None
m: int = 16
ef_search: int = 5
ef_construction: int = 200
configuration: Dict[str, Any] = {
"maintenance_work_mem": "2GB",
}
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key