Commit 8037476
feat(adapters): SME adapter for the Go MemPalace server (#255)
Add MemPalaceServerAdapter for sefodo26's Go reimplementation of the
MemPalace server (fork: techempower-org/mempalace-server). Talks to the
server's REST API (/mp/api/v1, bearer auth) — the same shape the Go
project's own benchmark harness uses — so SME numbers stay comparable.
- ingest_corpus: one drawer per row (content ← document|content|text;
wing/room ← row|metadata|session_id|id fallbacks), optional
wing-scoped reset-before-ingest for per-question-haystack isolation.
Handles the server's deterministic-id idempotency (already_exists) and
bullet-splitting (bullets_stored) responses. Never raises on transport
failure — errors are captured into the result dict.
- query: POST /search, constructor n_results default, optional
wing/room/max_distance (omitted by default → server default, matching
the reference benchmark). Returns a QueryResult with error set, never
raises.
- get_graph_snapshot: projects GET /taxonomy through the shared
project_graph (wing/room/member_of), identical to the daemon adapter.
- reset(wing=None): paginated list+delete isolation (the server has no
per-request tenant; MEMPALACE_TENANT_ID is server-level config).
- get_harness_manifest: real Cat 9b surfaces — the MCP endpoint (health
probe) and REST search — since the server's core identity is an MCP
server. get_flat_retrieval / get_ontology_source provided.
- Config via constructor → env (MEMPALACE_SERVER_URL / _API_KEY /
_TENANT) → docker-compose defaults; zero-config against a fresh
`docker compose up`.
Registered in sme.cli (aliases mempalace-server / mempalace_server /
mp-server; no rename). Added to the fork contract test kit. 31 mocked
unit tests (fake_urlopen_factory) + 1 opt-in live round-trip test
(MEMPALACE_SERVER_LIVE=1, skips cleanly when absent). ruff check clean;
full suite green (pre-existing hindsight network failures unrelated).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent c422883 commit 8037476
4 files changed
Lines changed: 1063 additions & 0 deletions
File tree
- sme
- adapters
- tests
0 commit comments