solidworks_mcp.agents.retrieval_index¶
solidworks_mcp.agents.retrieval_index ¶
Local retrieval index builder for feature-tree audits, tool docs, and failures.
Attributes¶
DEFAULT_DB_PATH
module-attribute
¶
Functions¶
_chunk_text ¶
Split long text into overlapping chunks for simple local retrieval.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Input text processed by the operation. |
required |
chunk_size
|
int
|
Maximum number of characters to keep in each chunk. Defaults to 1000. |
1000
|
overlap
|
int
|
Number of overlapping characters between chunks. Defaults to 150. |
150
|
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: A list containing the resulting items. |
Source code in src/solidworks_mcp/agents/retrieval_index.py
_read_text ¶
Build internal text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Filesystem path for the operation. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The resulting text value. |
Source code in src/solidworks_mcp/agents/retrieval_index.py
build_local_retrieval_index ¶
build_local_retrieval_index(*, output_path: Path | None = None, worked_examples_path: Path | None = None, tool_catalog_dir: Path | None = None, db_path: Path | None = None, max_recent_errors: int = 200) -> dict[str, Any]
Build a JSON retrieval index from local audits, tool docs, and failures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
Path | None
|
The output path value. Defaults to None. |
None
|
worked_examples_path
|
Path | None
|
The worked examples path value. Defaults to None. |
None
|
tool_catalog_dir
|
Path | None
|
The tool catalog dir value. Defaults to None. |
None
|
db_path
|
Path | None
|
The db path value. Defaults to None. |
None
|
max_recent_errors
|
int
|
The max recent errors value. Defaults to 200. |
200
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: A dictionary containing the resulting values. |
Source code in src/solidworks_mcp/agents/retrieval_index.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
find_recent_errors ¶
Return recent errors so agents can avoid repeated failing states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
int
|
The limit value. Defaults to 20. |
20
|
db_path
|
Path | None
|
The db path value. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
list[dict[str, Any]]: A list containing the resulting items. |