Moss
MossToolSpec #
Bases: BaseToolSpec
Moss Tool Spec.
This tool allows agents to interact with the Moss search engine to index documents and query for relevant information.
Source code in llama-index-integrations/tools/llama-index-tools-moss/llama_index/tools/moss/base.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
query
async
#
query(query: str) -> str
Search the Moss knowledge base for information relevant to a specific query.
This tool performs a hybrid semantic search to find the most relevant text snippets from the indexed documents. It is best used for answering technical questions, retrieving facts, or finding specific context within a large collection of documents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The search terms or question to look up in the index. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A formatted report containing the top matching text snippets, their relevance scores, and their source metadata (like filename). |
Source code in llama-index-integrations/tools/llama-index-tools-moss/llama_index/tools/moss/base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
list_indexes
async
#
list_indexes() -> str
List all available indexes in the Moss project.
Use this tool to discover what indexes exist before querying or managing them.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A formatted list of all index names in the project. |
Source code in llama-index-integrations/tools/llama-index-tools-moss/llama_index/tools/moss/base.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
delete_index
async
#
delete_index(index_name: str) -> str
Delete an index from the Moss project.
Use this tool to remove an index and all its documents when it is no longer needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_name
|
str
|
The name of the index to delete. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A confirmation message indicating the index was deleted. |
Source code in llama-index-integrations/tools/llama-index-tools-moss/llama_index/tools/moss/base.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
QueryOptions
dataclass
#
Configuration options for Moss search queries.
Attributes:
| Name | Type | Description |
|---|---|---|
top_k |
int
|
Number of results to return from queries. Defaults to 5. |
alpha |
float
|
Hybrid search weight (0.0=keyword, 1.0=semantic). Defaults to 0.5. |
model_id |
str
|
The embedding model ID used when creating the index. Defaults to "moss-minilm". |
Source code in llama-index-integrations/tools/llama-index-tools-moss/llama_index/tools/moss/base.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
options: members: - MossToolSpec