studio.create_knowledge_base() with customizable vector stores, embedding models, and configurations.
Quick Start
Function Signature
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | str | Yes | - | KB name (lowercase, numbers, underscores only) |
vector_store | str | No | "qdrant" | Vector store provider |
embedding_model | str | No | "text-embedding-3-large" | Embedding model for vectorization |
llm_model | str | No | "gpt-4o" | LLM for query processing |
description | str | No | None | KB description (max 1000 chars) |
Name Requirements
Thename parameter must:
- Contain only lowercase letters, numbers, and underscores
- Be 1-100 characters long
Vector Store Options
| Provider | Value | Description |
|---|---|---|
| Qdrant | "qdrant" | High-performance, default choice |
| Weaviate | "weaviate" | Open-source, GraphQL API |
| PG Vector | "pg_vector" | PostgreSQL extension |
| Milvus | "milvus" | Scalable, cloud-native |
| Neptune | "neptune" | Amazon Neptune |
Examples
Embedding Models
The embedding model converts text into vectors for similarity search.LLM Model
The LLM model processes queries and generates responses from retrieved content.Examples
Basic Knowledge Base
Full Configuration
Multiple Knowledge Bases
Return Value
Returns aKnowledgeBase object with methods:
| Method | Description |
|---|---|
add_pdf() | Add PDF document |
add_docx() | Add Word document |
add_txt() | Add text file |
add_website() | Add website content |
add_text() | Add raw text |
query() | Search the knowledge base |
list_documents() | List all documents |
delete_documents() | Delete specific documents |
reset() | Clear all documents |
update() | Update configuration |
delete() | Delete the knowledge base |
with_config() | Create runtime configuration |
KnowledgeBase Properties
| Property | Type | Description |
|---|---|---|
id | str | Unique identifier |
name | str | KB name |
collection_name | str | Vector DB collection name |
description | str | KB description |
vector_store_provider | str | Vector store display name |
embedding_model | str | Embedding model name |
llm_model | str | LLM model name |
created_at | str | Creation timestamp |
updated_at | str | Last update timestamp |