VecDBItem (vec_dbs/item.py)

MemTensor/MemOS · src/memos/vec_dbs/item.py · python · Apache-2.0
database

A standardized Pydantic model for representing vector database items and their associated metadata across different vector storage implementations.

# Source: https://github.com/MemTensor/MemOS | 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.
"""Defines vector database item types."""

import uuid

from typing import Any

from pydantic import BaseModel, ConfigDict, Field, field_validator


class VecDBItem(BaseModel):
    """Represents a single item in the vector database.

    This serves as a standardized format for vector database items across different
    vector database implementations (Qdrant, FAISS, Weaviate, etc.).
    """

    id: str = Field(default=str(uuid.uuid4()), description="Unique identifier for the item")
    vector: list[float] | None = Field(default=None, description="Embedding vector")
    payload: dict[str, 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key