You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLEANUP.md
+16-19Lines changed: 16 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,37 +10,34 @@ place, and the exact remediation steps required to bring the implementation in l
10
10
-**Files**: `meshmind/_compat/pydantic.py`, modules importing from `meshmind._compat.pydantic`.
11
11
-**Status**: Completed – the shim has been removed, `pydantic>=2.11` is a required dependency, and all models/tests now consume the official APIs directly.
-**Status**: Completed – protobuf definitions now live under `meshmind/protos`, generated modules back the Python stub, setup scripts install `grpcio`/`grpcio-tools`, and tests exercise the canonical schema.
25
22
26
23
### Promote gRPC Server Implementation
27
-
-**Files**: `meshmind/api/grpc.py`, future server entry point, integration tests.
28
-
-**Current State**: Tests rely on the in-process stub; there is no deployable server or channel bootstrap yet.
| FastAPI REST stub |`meshmind/api/rest.py` (`RestAPIStub`, `create_app`) | Exposes REST behaviour without the FastAPI dependency. | Tests use the stub when FastAPI is not installed; production should use FastAPI. | Keep temporarily for offline tests but plan to gate it behind an explicit test flag once FastAPI becomes mandatory. |
10
9
| gRPC stub implementation |`meshmind/api/grpc.py` (`GrpcServiceStub` + generated protobuf helpers) | Provides an in-process service implementation backed by the canonical proto schema so tests can exercise the service layer without spinning up gRPC infrastructure. | Unit tests and docs rely on the stub while production traffic should flow through the new asyncio helpers in `meshmind.api.grpc_server`. | Keep the stub for tests; package the new server behind a CLI entry point and retire any ad-hoc wrappers once infrastructure is provisioned. |
11
-
| Celery dummy app |`meshmind/tasks/celery_app.py` (`_DummyCeleryApp`) | Allows module imports when Celery is missing. | Unit tests rely on the dummy to avoid Celery; production should use real Celery. | Retire dummy once Celery is a hard dependency; until then ensure tests explicitly exercise the real app when installed. |
12
-
| Celery beat fallback |`meshmind/tasks/scheduled.py` (`crontab` shim) | Supplies a no-op crontab when Celery beat is missing. | Prevents import errors in test environments without Celery. | Remove once Celery is required; otherwise guard usage with feature flags. |
13
10
| Fake graph/storage drivers |`meshmind/testing/fakes.py` (`FakeMemgraphDriver`, `FakeRedisBroker`, `FakeEmbeddingEncoder`) | Provide offline stand-ins for Memgraph, Redis, and embedding models. | Pytest fixtures and documentation rely on these for isolation. | Keep as long as offline tests are desired; supplement with integration suites that use real services. |
14
11
| Fake LLM client |`meshmind/testing/fakes.py` (`FakeLLMClient`) | Records per-request overrides and emits deterministic responses so tests exercise reranking without installing the OpenAI SDK. | Service/interface tests (`meshmind/tests/test_service_interfaces.py`, `test_client.py`) and the CLI fixtures inject this stub when `openai` is unavailable. | Keep for unit tests; add integration tests with real providers once keys and network access are provisioned. |
15
12
| Dummy encoder fixture |`meshmind/tests/conftest.py` (`dummy_encoder`) and dependent tests | Supplies a lightweight embedding encoder for search tests. | Used across retrieval and service tests to avoid network calls. | Keep for unit tests; add integration coverage with real encoders once APIs are configured. |
@@ -18,3 +15,5 @@ recommended next step now that full dependencies can be installed.
18
15
## Retired Items
19
16
20
17
-**Pydantic compatibility shim (`meshmind/_compat/pydantic.py`)** – Removed now that the project installs `pydantic>=2.11` during setup. All models import directly from Pydantic and tests confirm no fallback is required.
18
+
-**FastAPI REST stub (`meshmind/api/rest.py`)** – Removed in favour of the concrete FastAPI application now that `fastapi` is a required dependency and tests exercise it via `TestClient`.
19
+
-**Celery dummy app and beat fallback (`meshmind/tasks/celery_app.py`, `meshmind/tasks/scheduled.py`)** – Retired because Celery is now installed by default; the real app and `crontab` integration are always imported.
Copy file name to clipboardExpand all lines: FINDINGS.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## General Observations
4
4
- Core modules are now wired through the `MeshMind` client, including CRUD, triplet storage, and retrieval helpers. Graph-backed wrappers fetch namespace/entity-label filtered candidates from the configured driver automatically; remaining integration work focuses on server-side query optimisation and heuristic evaluation loops.
5
-
- Optional dependencies are largely guarded behind lazy imports or factory functions, improving portability. Environments still need to install tooling referenced by the Makefile and CI (ruff, pyright, typeguard, toml-sort, yamllint). `DUMMIES.md` now tracks remaining shims (FastAPI/gRPC/Celery) and documents retired items such as the former Pydantic fallback.
5
+
- Optional dependencies are largely guarded behind lazy imports or factory functions, improving portability. Environments still need to install tooling referenced by the Makefile and CI (ruff, pyright, typeguard, toml-sort, yamllint). `DUMMIES.md` now tracks remaining shims (gRPC stub, offline fakes) and documents retired items such as the former Pydantic fallback.
6
6
- LLM usage is now centralized in `meshmind.llm_client` with per-operation defaults cascading from `LLM_*` environment variables and CLI overrides, reducing the risk of divergent configurations across pipelines and retrieval. REST/gRPC payloads now provide matching override dictionaries so services can experiment per request.
7
7
- Timestamp helpers default to timezone-aware UTC, eliminating naive datetime outputs that previously leaked into maintenance pipelines and compatibility shims.
8
8
- The gRPC interface is now defined by `meshmind/protos/memory_service.proto`; generated Python modules back the `GrpcServiceStub`
@@ -22,7 +22,7 @@
22
22
embedding modules already encapsulate the SDK behind optional imports, easing the upcoming refactor to a dedicated
23
23
wrapper.
24
24
- Celery tasks initialize lazily, yet Redis/Memgraph services are still required at runtime. Docker Compose now provisions
25
-
Memgraph, Neo4j, and Redis, while targeted stacks under `meshmind/tests/docker/` support integration testing. `SETUP.md`
25
+
Memgraph, Neo4j, Redis, the gRPC server, and the Celery worker, while targeted stacks under `meshmind/tests/docker/` support integration testing. `SETUP.md`
26
26
explains provisioning and teardown commands, and `scripts/benchmark_pagination.py` offers an offline way to measure driver throughput before integrating external services.
Copy file name to clipboardExpand all lines: NEEDED_FOR_TESTING.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,10 @@
62
62
## Local Configuration Steps
63
63
- Ensure an embedding encoder is registered before extraction or hybrid search. The bootstrap utilities invoked by the CLI and
64
64
`MeshMind` constructor handle this, but custom scripts must call `bootstrap_encoders()`.
65
-
- For REST/gRPC testing, instantiate the `RestAPIStub`/`GrpcServiceStub` with the in-memory driver to avoid external services.
65
+
- For REST/gRPC testing, instantiate the FastAPI app via `meshmind.api.rest.create_app`
66
+
and exercise it with `fastapi.testclient.TestClient` (requires the `httpx`
67
+
package); pair it with the `GrpcServiceStub` for lightweight gRPC coverage when
68
+
external services are unavailable.
66
69
- Use `meshmind/testing` fakes (`FakeMemgraphDriver`, `FakeRedisBroker`, `FakeEmbeddingEncoder`, `FakeLLMClient`) in tests or demos to eliminate external infrastructure requirements.
67
70
- Invoke `meshmind admin predicates` and `meshmind admin maintenance --max-attempts <n> --base-delay <seconds> --run <task>` during local runs to inspect predicate registries, telemetry, and tune maintenance retries without external services.
68
71
- Use the benchmarking utilities in `scripts/` (`evaluate_importance.py`, `consolidation_benchmark.py`, `benchmark_pagination.py`) to validate heuristics and driver performance offline before connecting to live infrastructure.
Copy file name to clipboardExpand all lines: PLAN.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,14 +35,17 @@
35
35
incrementally.
36
36
2.**Automation & CI** – Makefile provides lint/format/type/test/docs-guard targets and CI runs fmt-check, docs guard, and
37
37
pytest. Protobuf drift now fails CI via `make protos-check`. Add caching and matrix builds when dependencies stabilize.
38
-
3.**Environment Provisioning** – Docker Compose now provisions Memgraph, Neo4j, and Redis (with targeted stacks for tests).
39
-
Track multi-backend examples, document the new `SETUP.md`, keep docs current, and distribute the new `run/install_setup.sh`
40
-
and `run/maintenance_setup.sh` automation scripts for environment bootstrap.
38
+
3.**Environment Provisioning** – Docker Compose now provisions Memgraph, Neo4j,
39
+
Redis, the gRPC server, and the Celery worker (with targeted stacks for tests).
40
+
Track multi-backend examples, document the new `SETUP.md`, keep docs current,
41
+
and distribute the new `run/install_setup.sh` and `run/maintenance_setup.sh`
42
+
automation scripts for environment bootstrap.
41
43
42
44
## Phase 5 – Strategic Enhancements (Planned)
43
45
1.**Graph-Backed Retrieval** – Extend the new driver-side filtering/pagination to full vector/lexical execution using backend-native indexes to avoid round-tripping candidate embeddings.
44
46
2.**Operational Observability** – Export telemetry to Prometheus/OpenTelemetry and surface dashboards/alerts.
45
47
3.**Celery Hardening** – Stress test consolidation/compression heuristics at scale and codify retry/backoff policies.
46
-
4.**Service Contracts** – Generated protobuf modules (`meshmind/protos/memory_service.proto`) back both the Python stub and the
47
-
new asyncio gRPC server helpers. Next: package a deployable entry point, publish generated clients, and add integration tests
Copy file name to clipboardExpand all lines: PROJECT.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,10 @@
19
19
initialize lazily so import-time failures are avoided.
20
20
-**Support code**: `meshmind.core` provides configuration, data models, embeddings, similarity math, and optional dependency
21
21
guards around tokenization.
22
-
-**Service adapters**: `meshmind.api.rest` and `.grpc` expose REST/gRPC entry points. The gRPC surface now uses generated
23
-
protobuf messages (`meshmind/protos/memory_service.proto`) and runtime helpers in `meshmind.api.grpc_server` so tests,
24
-
scripts, and deployments share a canonical schema while retaining the in-process stub for fast feedback.
22
+
-**Service adapters**: `meshmind.api.rest` exposes a FastAPI application, while
23
+
`.grpc` ships generated protobuf stubs alongside asyncio server helpers and a CLI
24
+
(`meshmind serve-grpc`) so deployments share a canonical schema while retaining
25
+
the in-process stub for fast feedback.
25
26
-**Observability**: `meshmind.core.observability` collects metrics, gauges, and structured log events across pipelines and
26
27
scheduled tasks.
27
28
-**Tooling**: The CLI ingest command (`meshmind ingest`), updated example script, Makefile automation, CI workflow, and Docker
@@ -54,8 +55,8 @@
54
55
- Graph-backed retrieval still hydrates namespace/entity-label filtered candidates client-side; pushing ranking into the graph store is future work.
55
56
- Predicate management remains internal to the bootstrap process; external administration APIs are still missing.
56
57
- Metrics remain in-memory; external exporters (Prometheus/OpenTelemetry) are not wired up.
57
-
- gRPC deployments now rely on the asyncio server helpers; packaging an executable entry point and adding end-to-end integration
58
-
tests remain future work.
58
+
- gRPC deployments now rely on the asyncio server helpers; end-to-end integration
59
+
tests against a live CLI-managed server remain future work.
59
60
60
61
## External Services & Dependencies
61
62
-**Graph backend**: Choose via `GRAPH_BACKEND`. In-memory and SQLite require no external services. Memgraph needs the `pymgclient` package (which exposes the `mgclient` module);
@@ -190,8 +191,8 @@ Tasks instantiate the driver lazily, emit structured logs/metrics, and persist c
190
191
to ensure code changes keep the wiki up to date.
191
192
-**Examples** – `examples/extract_preprocess_store_example.py` demonstrates ingestion, triplet creation, and multiple retrieval
192
193
strategies.
193
-
-**Dockerfile / docker-compose** – Container definition and orchestration files that provision Memgraph, Neo4j, Redis, and the
194
-
Celery worker stacks documented in `SETUP.md` and `meshmind/tests/docker/`.
194
+
-**Dockerfile / docker-compose** – Container definition and orchestration files that provision Memgraph, Neo4j, Redis, the
195
+
Celery worker, and the gRPC server documented in `SETUP.md` and `meshmind/tests/docker/`.
195
196
-**Provisioning scripts** – `run/install_setup.sh` and `run/maintenance_setup.sh` validate that optional packages (`fastapi`,
196
197
`neo4j`, `pymgclient`, `uvicorn`) are present and respect `MESH_SKIP_SYSTEM_PACKAGES=1` / `MESH_SKIP_PYTHON_SYNC=1` when you
197
198
need a dry run without network access.
@@ -206,7 +207,7 @@ Tasks instantiate the driver lazily, emit structured logs/metrics, and persist c
206
207
Use `make benchmarks` to run all three scripts with synthetic defaults and capture JSON summaries under `build/benchmarks/`.
207
208
208
209
## Service Interfaces
209
-
-**REST** – `meshmind.api.rest.create_app` returns a FastAPI app (or lightweight stub) that exposes `/memories`, `/triplets`,
210
+
-**REST** – `meshmind.api.rest.create_app` returns a FastAPI app that exposes `/memories`, `/triplets`,
210
211
`/search`, and `/memories/counts` endpoints. Search payloads accept:
211
212
-`use_llm_rerank` to toggle LLM-based reranking,
212
213
-`llm_models`, `llm_base_urls`, and `llm_api_key` dictionaries for per-request overrides,
@@ -264,8 +265,9 @@ Tasks instantiate the driver lazily, emit structured logs/metrics, and persist c
264
265
- MeshMind now depends on first-party Pydantic 2.x models; the legacy compatibility shim has been removed.
265
266
-`meshmind/retrieval/bm25.py`, `meshmind/retrieval/fuzzy.py`, and `meshmind/core/similarity.py` include pure-Python fallbacks for scikit-learn, rapidfuzz, and numpy.
266
267
-`meshmind/testing` exports fake Memgraph, Redis, and embedding drivers that power the pytest suite and examples without external infrastructure.
267
-
-`DUMMIES.md` lists every remaining stub (REST/gRPC service adapters, Celery fallbacks, compatibility layers) with guidance
268
-
on whether to remove or preserve them once external services are provisioned.
268
+
-`DUMMIES.md` lists every remaining stub (for example the gRPC in-process adapter
269
+
and offline test doubles) with guidance on whether to remove or preserve them
270
+
once external services are provisioned.
269
271
270
272
## Testing
271
273
- Run `pytest` to execute the suite; tests rely on fixtures and fake drivers so they do not require external services or optional libraries.
0 commit comments