MossClient
Semantic search client for vector similarity operations.Methods
create_index()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Name of the index to create. |
docs | List[DocumentInfo] | Yes | Documents to ingest into the index. |
model_id | str | Yes | Identifier for the embedding model. |
bool - True if the creation request succeeded.
get_index()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Name of the index to inspect. |
IndexInfo - Metadata describing the requested index.
list_indexes()
IndexInfo] - Collection of index metadata objects.
delete_index()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Name of the index to delete. |
bool - True if the deletion request succeeded.
load_index()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Name of the index to load. |
str - Identifier or status describing the loaded index.
add_docs()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Target index name. |
docs | List[DocumentInfo] | Yes | Documents to add or upsert. |
options | Optional[AddDocumentsOptions] | No | Upsert behavior overrides. |
Dict[str, int] - Mutation counts such as inserted or updated totals.
delete_docs()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Target index name. |
doc_ids | List[str] | Yes | Identifiers of documents to delete. |
Dict[str, int] - Summary counts for deleted documents.
get_docs()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Target index name. |
options | Optional[GetDocumentsOptions] | No | Retrieval filters. |
DocumentInfo] - Documents that satisfy the filters.
query()
| Name | Type | Required | Description |
|---|---|---|---|
index_name | str | Yes | Target index name. |
query | str | Yes | Natural language query string. |
top_k | int | Yes | Maximum number of documents to return. |
alpha | Optional[float] | No | Hybrid weighting value. |
SearchResult - Ranked documents and metadata for the query.