crewai-goodmem 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ *.egg-info/
8
+ *.egg
9
+ build/
10
+ dist/
11
+ wheels/
12
+ *.whl
13
+
14
+ # Virtual envs
15
+ .venv/
16
+ .venv-*/
17
+ venv/
18
+ env/
19
+
20
+ # Tooling caches
21
+ .pytest_cache/
22
+ .mypy_cache/
23
+ .ruff_cache/
24
+ .coverage
25
+ .coverage.*
26
+ htmlcov/
27
+ coverage.xml
28
+ .tox/
29
+
30
+ # IDE
31
+ .idea/
32
+ .vscode/
33
+ *.swp
34
+ .DS_Store
35
+
36
+ # Local secrets
37
+ .env
38
+ .env.local
39
+ .env.*.local
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.1] — 2026-04-28
11
+
12
+ ### Changed
13
+ - Drop Python 3.10 support. The transitive `onnxruntime` dependency (via
14
+ `crewai → chromadb`) no longer ships 3.10 wheels in current versions, so
15
+ installs failed in practice. Supported versions are now 3.11 / 3.12 / 3.13.
16
+
17
+ ### Fixed
18
+ - README install banner correctly states the supported Python range.
19
+ - Pin `UV_PYTHON` per CI matrix entry so `uv run` doesn't silently rebuild
20
+ the venv against `.python-version` instead of the matrix Python.
21
+
22
+ ## [0.1.0] — 2026-04-27
23
+
24
+ ### Added
25
+ - Initial release.
26
+ - Eleven CrewAI tools covering the GoodMem v1 REST surface: embedders, spaces
27
+ (CRUD), memories (CRUD), and semantic retrieval with optional reranking, LLM
28
+ summarization, and SQL-style JSONPath metadata filtering.
29
+ - `wait_for_memories_completed(memory_ids, *, timeout, interval, ...)` helper
30
+ that polls each memory's `processingStatus` until it reaches a terminal
31
+ state, replacing blind `time.sleep` waits in the example and live test.
32
+ - Apache 2.0 license, type stubs (PEP 561), and full type annotations.
33
+ - Mocked unit-test suite covering every tool.
34
+
35
+ [Unreleased]: https://github.com/PAIR-Systems-Inc/goodmem-crewai/compare/v0.1.1...HEAD
36
+ [0.1.1]: https://github.com/PAIR-Systems-Inc/goodmem-crewai/compare/v0.1.0...v0.1.1
37
+ [0.1.0]: https://github.com/PAIR-Systems-Inc/goodmem-crewai/releases/tag/v0.1.0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,5 @@
1
+ crewai-goodmem
2
+ Copyright 2026 PAIR Systems Inc
3
+
4
+ This product includes software developed at PAIR Systems Inc
5
+ (https://pairsys.ai/).
@@ -0,0 +1,302 @@
1
+ Metadata-Version: 2.4
2
+ Name: crewai-goodmem
3
+ Version: 0.1.1
4
+ Summary: GoodMem RAG tools for CrewAI agents
5
+ Project-URL: Homepage, https://github.com/PAIR-Systems-Inc/goodmem-crewai
6
+ Project-URL: Source, https://github.com/PAIR-Systems-Inc/goodmem-crewai
7
+ Project-URL: Documentation, https://docs.goodmem.com/integrations/crewai
8
+ Project-URL: Issues, https://github.com/PAIR-Systems-Inc/goodmem-crewai/issues
9
+ Project-URL: Changelog, https://github.com/PAIR-Systems-Inc/goodmem-crewai/blob/main/CHANGELOG.md
10
+ Author: PAIR Systems Inc
11
+ License: Apache-2.0
12
+ License-File: LICENSE
13
+ License-File: NOTICE
14
+ Keywords: agents,crewai,goodmem,memory,rag,tools
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: <3.14,>=3.11
26
+ Requires-Dist: crewai>=1.14.3
27
+ Requires-Dist: requests<3,>=2.33.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: mypy>=1.11; extra == 'dev'
30
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
31
+ Requires-Dist: pytest>=8; extra == 'dev'
32
+ Requires-Dist: python-dotenv>=1; extra == 'dev'
33
+ Requires-Dist: ruff>=0.6; extra == 'dev'
34
+ Requires-Dist: types-requests; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # crewai-goodmem
38
+
39
+ GoodMem RAG tools for [CrewAI](https://crewai.com) agents.
40
+
41
+ [GoodMem](https://goodmem.ai) is a self-hostable RAG service that handles
42
+ embedding, chunking, storage, and retrieval on the server. This package
43
+ exposes its REST surface as eleven `crewai.tools.BaseTool` classes so any
44
+ CrewAI agent can store documents, run semantic search, and manage memory
45
+ spaces directly.
46
+
47
+ ## Install
48
+
49
+ ```bash
50
+ pip install crewai-goodmem
51
+ # or
52
+ uv add crewai-goodmem
53
+ ```
54
+
55
+ Python 3.11–3.13 supported. The only runtime dependencies are `crewai` and
56
+ `requests`.
57
+
58
+ ## Quickstart
59
+
60
+ ```python
61
+ from crewai import Agent, Crew, Task
62
+ from crewai_goodmem import GoodMemRetrieveMemoriesTool
63
+
64
+ retrieve = GoodMemRetrieveMemoriesTool() # reads GOODMEM_BASE_URL / GOODMEM_API_KEY
65
+
66
+ researcher = Agent(
67
+ role="Knowledge Researcher",
68
+ goal="Answer questions from the team knowledge base.",
69
+ backstory="You always cite the retrieved memory chunks.",
70
+ tools=[retrieve],
71
+ )
72
+
73
+ task = Task(
74
+ description="Search space '<your-space-id>' for 'agent skills' and answer.",
75
+ expected_output="A grounded answer.",
76
+ agent=researcher,
77
+ )
78
+
79
+ print(Crew(agents=[researcher], tasks=[task]).kickoff())
80
+ ```
81
+
82
+ A full multi-scenario script lives at [`examples/basic_example.py`](examples/basic_example.py).
83
+
84
+ ## Configuration
85
+
86
+ Every tool reads the same three environment variables, with constructor
87
+ arguments taking precedence:
88
+
89
+ | Variable | Required | Description |
90
+ |---|---|---|
91
+ | `GOODMEM_BASE_URL` | Yes | Base URL of your GoodMem server (e.g. `https://localhost:8080`, `https://api.goodmem.ai`). |
92
+ | `GOODMEM_API_KEY` | Yes | API key issued by your GoodMem instance (starts with `gm_`). |
93
+ | `GOODMEM_VERIFY_SSL` | No | Set to `false` to skip TLS verification when pointing at a server with a self-signed certificate. |
94
+
95
+ Pass them at construction time instead if you prefer:
96
+
97
+ ```python
98
+ tool = GoodMemRetrieveMemoriesTool(
99
+ base_url="https://localhost:8080",
100
+ api_key="gm_...",
101
+ verify_ssl=False,
102
+ )
103
+ ```
104
+
105
+ ## Available tools
106
+
107
+ Eleven tools cover the complete GoodMem v1 REST surface — embedders, spaces
108
+ (CRUD), memories (CRUD), and semantic retrieval.
109
+
110
+ | Tool | Operation |
111
+ |---|---|
112
+ | `GoodMemListEmbeddersTool` | `GET /v1/embedders` |
113
+ | `GoodMemListSpacesTool` | `GET /v1/spaces` |
114
+ | `GoodMemGetSpaceTool` | `GET /v1/spaces/{id}` |
115
+ | `GoodMemCreateSpaceTool` | `POST /v1/spaces` (reuses if name exists) |
116
+ | `GoodMemUpdateSpaceTool` | `PUT /v1/spaces/{id}` |
117
+ | `GoodMemDeleteSpaceTool` | `DELETE /v1/spaces/{id}` |
118
+ | `GoodMemCreateMemoryTool` | `POST /v1/memories` |
119
+ | `GoodMemListMemoriesTool` | `GET /v1/spaces/{space_id}/memories` |
120
+ | `GoodMemRetrieveMemoriesTool` | `POST /v1/memories:retrieve` (NDJSON stream) |
121
+ | `GoodMemGetMemoryTool` | `GET /v1/memories/{id}` + `/content` |
122
+ | `GoodMemDeleteMemoryTool` | `DELETE /v1/memories/{id}` |
123
+
124
+ ### GoodMemCreateSpaceTool
125
+
126
+ Create a new space, or reuse an existing one with the same name.
127
+
128
+ | Argument | Required | Default | Description |
129
+ |---|---|---|---|
130
+ | `name` | Yes | — | Unique name for the space |
131
+ | `embedder_id` | Yes | — | ID of the embedder model for vector embeddings |
132
+ | `chunk_size` | No | 256 | Characters per chunk when splitting documents |
133
+ | `chunk_overlap` | No | 25 | Overlapping characters between consecutive chunks |
134
+ | `keep_strategy` | No | `KEEP_END` | Separator placement: `KEEP_END`, `KEEP_START`, `DISCARD` |
135
+ | `length_measurement` | No | `CHARACTER_COUNT` | `CHARACTER_COUNT` or `TOKEN_COUNT` |
136
+
137
+ ### GoodMemUpdateSpaceTool
138
+
139
+ Update a space's name, labels, or `publicRead` flag. Only fields you pass
140
+ are changed.
141
+
142
+ | Argument | Required | Description |
143
+ |---|---|---|
144
+ | `space_id` | Yes | UUID of the space to update |
145
+ | `name` | No | New name for the space |
146
+ | `public_read` | No | Toggle unauthenticated read access |
147
+ | `replace_labels_json` | No | JSON string that replaces all existing labels |
148
+ | `merge_labels_json` | No | JSON string that merges into existing labels |
149
+
150
+ `replace_labels_json` and `merge_labels_json` are mutually exclusive.
151
+
152
+ ### GoodMemCreateMemoryTool
153
+
154
+ Store a document or plain text as a memory. Binary content is base64-encoded
155
+ on upload.
156
+
157
+ | Argument | Required | Description |
158
+ |---|---|---|
159
+ | `space_id` | Yes | Space to store the memory in |
160
+ | `text_content` | No | Plain text content (used when no file is provided) |
161
+ | `file_path` | No | Local file path (PDF, DOCX, image, etc.). Takes priority over `text_content` |
162
+ | `metadata` | No | Key-value metadata as a JSON object |
163
+
164
+ ### GoodMemListMemoriesTool
165
+
166
+ List memories in a space with optional filtering and sorting.
167
+
168
+ | Argument | Required | Default | Description |
169
+ |---|---|---|---|
170
+ | `space_id` | Yes | — | UUID of the space to list from |
171
+ | `status_filter` | No | — | One of `PENDING`, `PROCESSING`, `COMPLETED`, `FAILED` |
172
+ | `include_content` | No | `false` | Include each memory's original content |
173
+ | `sort_by` | No | — | `created_at` or `updated_at` |
174
+ | `sort_order` | No | — | `ASCENDING` or `DESCENDING` |
175
+
176
+ ### GoodMemRetrieveMemoriesTool
177
+
178
+ Perform semantic search across one or more spaces. Supports reranking, LLM
179
+ summarization, chronological resort, and server-side metadata filtering via
180
+ SQL-style JSONPath expressions.
181
+
182
+ | Argument | Required | Default | Description |
183
+ |---|---|---|---|
184
+ | `query` | Yes | — | Natural language search query |
185
+ | `space_ids` | Yes | — | List of space IDs to search across |
186
+ | `max_results` | No | 5 | Maximum number of results |
187
+ | `include_memory_definition` | No | `true` | Fetch full memory metadata alongside chunks |
188
+ | `wait_for_indexing` | No | `true` | Retry polling when no results found |
189
+ | `max_wait_seconds` | No | 10 | Maximum seconds to poll when `wait_for_indexing` is `true` |
190
+ | `poll_interval` | No | 2 | Seconds between polling attempts |
191
+ | `reranker_id` | No | — | Reranker model ID for improved ordering |
192
+ | `llm_id` | No | — | LLM ID for contextual response generation |
193
+ | `relevance_threshold` | No | — | Minimum score (0–1). Used with reranker/LLM |
194
+ | `llm_temperature` | No | — | LLM creativity (0–2). Used when `llm_id` is set |
195
+ | `chronological_resort` | No | `false` | Reorder by creation time instead of relevance |
196
+ | `metadata_filter` | No | — | SQL-style JSONPath expression applied server-side. Applied to every space in `space_ids` |
197
+
198
+ ### GoodMemGetMemoryTool
199
+
200
+ Retrieve a memory by ID with metadata and optionally the original content.
201
+ Text content is returned verbatim (`contentEncoding: "text"`); binary
202
+ content is base64-encoded (`contentEncoding: "base64"`).
203
+
204
+ | Argument | Required | Default | Description |
205
+ |---|---|---|---|
206
+ | `memory_id` | Yes | — | UUID of the memory to fetch |
207
+ | `include_content` | No | `true` | Also fetch the original document content |
208
+
209
+ ### GoodMemDeleteMemoryTool
210
+
211
+ Permanently delete a memory and its chunks and embeddings.
212
+
213
+ | Argument | Required | Description |
214
+ |---|---|---|
215
+ | `memory_id` | Yes | UUID of the memory to delete |
216
+
217
+ ### GoodMemListSpacesTool / GoodMemListEmbeddersTool / GoodMemGetSpaceTool / GoodMemDeleteSpaceTool
218
+
219
+ `List` tools take no arguments. `GetSpace` and `DeleteSpace` take a single
220
+ `space_id`.
221
+
222
+ ## Waiting for indexing
223
+
224
+ Memory ingestion is asynchronous: `GoodMemCreateMemoryTool` returns once the
225
+ record exists, but the chunks aren't searchable until the server finishes
226
+ embedding them. Instead of guessing with a fixed sleep, poll the actual
227
+ `processingStatus`:
228
+
229
+ ```python
230
+ from crewai_goodmem import wait_for_memories_completed
231
+
232
+ statuses = wait_for_memories_completed(
233
+ [memory_id_1, memory_id_2],
234
+ timeout=60.0,
235
+ )
236
+ # {'mem-1': 'COMPLETED', 'mem-2': 'COMPLETED'}
237
+ ```
238
+
239
+ The function returns once every id has reached a terminal status
240
+ (`COMPLETED` or `FAILED`), or raises `TimeoutError` if the deadline elapses.
241
+ Configure with `timeout` (max seconds) and `interval` (poll frequency).
242
+
243
+ ## Metadata filtering
244
+
245
+ Tag memories at creation time and filter server-side at retrieval time:
246
+
247
+ ```python
248
+ from crewai_goodmem import GoodMemCreateMemoryTool, GoodMemRetrieveMemoriesTool
249
+ import json
250
+
251
+ create = GoodMemCreateMemoryTool()
252
+ retrieve = GoodMemRetrieveMemoriesTool()
253
+
254
+ create._run(
255
+ space_id=space_id,
256
+ text_content="Shipped the CSV export feature.",
257
+ metadata={"category": "feat"},
258
+ )
259
+
260
+ result = retrieve._run(
261
+ query="new features",
262
+ space_ids=[space_id],
263
+ metadata_filter="CAST(val('$.category') AS TEXT) = 'feat'",
264
+ )
265
+ print(json.loads(result)["results"])
266
+ ```
267
+
268
+ The filter is a SQL-style JSONPath expression evaluated by GoodMem. When
269
+ set, the same filter is applied to every space in `space_ids`.
270
+
271
+ ## Development
272
+
273
+ ```bash
274
+ uv venv
275
+ uv sync --extra dev
276
+
277
+ uv run ruff check .
278
+ uv run ruff format --check .
279
+ uv run mypy src
280
+ uv run pytest # mocked unit tests only
281
+
282
+ # live tests require a running GoodMem server
283
+ GOODMEM_BASE_URL=https://localhost:8080 \
284
+ GOODMEM_API_KEY=gm_... \
285
+ uv run pytest -m e2e
286
+ ```
287
+
288
+ Conventional Commits are enforced via pre-commit. Install with:
289
+
290
+ ```bash
291
+ uv run pre-commit install
292
+ ```
293
+
294
+ ## Links
295
+
296
+ - [GoodMem documentation](https://docs.goodmem.com/)
297
+ - [GoodMem CrewAI integration docs](https://docs.goodmem.com/integrations/crewai)
298
+ - [CrewAI documentation](https://docs.crewai.com/)
299
+
300
+ ## License
301
+
302
+ Apache License 2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).