Knowledge Base Types

Python SDK - Knowledge Base type definitions

Types for knowledge base operations.

KnowledgeBase

A knowledge base for semantic document search.

Fields:

  • createdAt: datetime | None - Timestamp when the knowledge base was created.

  • description: str | None - Description of the knowledge base.

  • documentCount: int | None - Number of documents in the knowledge base.

  • id: str - Unique knowledge base ID.

  • isActive: bool - Whether the knowledge base is active.

  • model_config: Any

  • name: str - Name of the knowledge base.

  • schema_: dict[str, Any] | None - JSON schema for documents in this knowledge base.

  • updatedAt: datetime | None - Timestamp when the knowledge base was last updated.

KnowledgeBaseDocument

A document stored in a knowledge base.

Fields:

  • content: dict[str, Any] - Document content matching the knowledge base schema.

  • createdAt: datetime | None - Timestamp when the document was added.

  • documentId: str | None - External document reference ID.

  • id: str - Unique document ID within the knowledge base.

  • metadata: dict[str, Any] | None - Additional metadata for the document.

  • model_config: Any

  • updatedAt: datetime | None - Timestamp when the document was last updated.

SearchResult

Result of a semantic search operation.

Fields:

  • data: list[SearchResultItem] - List of matching documents with similarity scores.

  • model_config: Any

  • query: str | None - The processed search query.

  • resultsCount: int - Total number of results returned.

SearchResultItem

A single search result with similarity score.

Fields:

  • document: KnowledgeBaseDocument - The matched document.

  • model_config: Any

  • similarity: float - Similarity score (0-1), higher is more similar.

SyncResult

Result of a knowledge base synchronization operation.

Fields:

  • completedAt: datetime | None - Timestamp when sync completed.

  • documentsProcessed: int | None - Number of documents processed during sync.

  • errors: list[str] | None - Any errors encountered during sync.

  • model_config: Any

  • startedAt: datetime | None - Timestamp when sync started.

  • status: str - Sync status (e.g., 'started', 'completed', 'failed').

  • syncId: str | None - Unique sync operation ID.

On this page