docs+test(readme): combined unifiedSearch + nearbyPlaces ORM example backed by a real integration test#28
Merged
pyramation merged 4 commits intomainfrom Apr 18, 2026
Conversation
… combined unified-search+spatial ORM example
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…h + spatial example
… bump graphile-settings to 4.21.0
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Started as docs-only; grew a small test + two dependency/CLI fixes in service of making the docs' claim provable.
Docs (both READMEs, kept in sync):
PostGIS spatialbullet to distinguish scalar filters shipping today (bboxIntersects2D,isNull, GIST indexes) from the new cross-table layer.Cross-table spatial relations (@spatialRelation)bullet listing the 5 blueprint-declared virtual relations (memory.nearbyPlaces,memory.nearbyContacts,trip.nearbyVenues,event.nearbyVenues,memory.nearbyMemories) with their default radii, linking topackages/provision/src/schemas/spatial-relations.ts.unifiedSearchwithnearbyPlacesin onewhere:clause and selectssearchScore+locationGeo { geojson, srid }, plus a one-liner explaining what the server compiles that into (aunified_search(...)CTE joined against anEXISTS (… ST_DWithin …)subquery — no GeoJSON over the wire).New test — the proof behind the combined example:
packages/agentic-db/__tests__/unified-spatial-combined.test.ts— uses the@constructive-io/graphql-testharness (which bundlesConstructivePreset→UnifiedSearchPreset), seeds 3 memories + 2 market-category places at known coordinates, runs the exactmemory.findMany({ where: { unifiedSearch, nearbyPlaces } })shape from the README through the generated SDK, asserts only the positive-match memory is returned andsearchScoreis non-null.Dev-dep bump (test harness only):
packages/agentic-db/package.json—graphile-settings4.18.5 → 4.21.0 so the test-harness runtime schema matches production. The old pin transitively resolvedgraphile-search@1.5.6, which registered the composite filter asfullTextSearch; 1.7.0 renamed it tounifiedSearch(the name already exposed by the regenerated SDK schema in chore: regenerate SDK/CLI/schemas end-to-end with spatial-relations blueprint #27). Without this bump, the new test fails with Field 'unifiedSearch' is not defined by type 'MemoryFilter' — the symptom that surfaced the mismatch.CLI fix uncovered by the bump:
sdk/cli/src/commands/search.ts— hand-authored CLI that still hardcodedfullTextSearchin itsHYBRID_CONDITION. Worked against the old harness, broke against the new one (cli-e2e-tests surfacedGraphQLError: Field "fullTextSearch" is not defined by type "ContactFilter"and similar across 12 filter types). Renamed tounifiedSearchto match the current SDK/schema. Pure one-word find-and-replace in 3 places.Related work (context, not part of this PR): constructive-db #840/#843/#844/#863/#865, constructive #993/#997/#1001, agentic-db #24/#26/#27.
Review & Testing Checklist for Human
fullTextSearchwas the filter name on servers built againstgraphile-search@<1.7.0;unifiedSearchis the name on newer servers. The CLI now only talks to the new name. Confirm there are no production-deployed agentic-db servers still on the old plugin version that the CLI is expected to hit.graphile-settingsbump is scoped topackages/agentic-db/devDependenciesand doesn't leak into any shipped package. Spot-check the pnpm lockfile diff for that (there are some expected incidentalgraphile-upload-pluginsnapshot additions because peer resolution re-keyed, but no first-party package gained a new runtime dep).pnpm exec jest --testPathPatterns=unified-spatial-combined, 14s) and in CI (orm-tests,cli-e2e-tests,rag-testsall green on 81466ea). Still worth eyeballing the assertions inunified-spatial-combined.test.tsto confirm they'd actually fail if the composition stopped working — specifically that the negative-match seed rows (NYC memory, Tokyo place) would not slip through.packages/agentic-db/README.mdstay identical — this PR keeps them in sync; if they're meant to diverge (e.g., package README trimmed to schema-only), say the word and I'll split them.Notes
distanceat query time.Link to Devin session: https://app.devin.ai/sessions/c5eeee65a3c546c4ac6753bb05fa03e0
Requested by: @pyramation