Repository navigation
feat(langgraph): add ebbmem-langgraph BaseStore, middleware, and LangMem tools (P1-06) - #9
Merged
Merged
Conversation
…Mem tools (P1-06) Signed-off-by: Bharat Joshi <200157101+sbharatjoshi@users.noreply.github.com>
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.
What and Why
Adds the
ebbmem-langgraphPython package underpackages/langgraph-python/(P1-06), built directly on top ofebbmem-integration-core(packages/python/, untouched):EbbmemStore(BaseStore)(ebbmem_langgraph.store): Implements LangGraph's full async and syncBaseStorecontract (abatch/batch,aput/put,aget/get,adelete/delete,asearch/searchwith semanticqueryand JSONB-style operatorfilters,alist_namespaces/list_namespaces,supports_ttl=False). Keeps no process-local item dictionary; all state lives in EbbMem.ScopeResolver({tenant}:u:{user_id}, explicitapp_namespace, or optionaluser_id_from_namespace), avoiding per-tuple namespace explosion while mapping LangGraph hierarchy tuples to normalized IC-1 tags (session:<id>extracted tosession_id) and metadata.ebbmem-client0.2.0Gaps: Defaults toebbmem-integration-core'sStdlibHttpTransport/AsyncStdlibHttpTransportfor full IC-1 REST parity, and provides client-side fallback (withinscan_limit) plusstrict_sdk_capabilities=True(UnsupportedCapabilityError) when wrappingebbmem-client0.2.0.getandsearch(recall) remain strictly read-only (reinforce=False); explicitreinforce/areinforceandreinforce_from_exposure/areinforce_from_exposuremethods support post-use reinforcement (injected=Falsedefault);delete/adeletealways maps to soft-tombstoneforget, never physicalpurge.EbbmemMemoryMiddleware(AgentMiddleware)(ebbmem_langgraph.middleware): Sync/asyncwrap_model_callmiddleware for LangChaincreate_agentthat recalls memories before model execution, injects them wrapped in<ebbmem_untrusted_memory_context>delimiters, reinforces only cited/used memories after execution, and optionally captures turns with deterministic idempotency keys and secret redaction (fail-open).ebbmem_langgraph.tools):create_ebbmem_manage_memory_tool,create_ebbmem_search_memory_tool, andcreate_ebbmem_reinforce_memory_tool, plus verified compatibility withlangmem.create_memory_store_manager(store=EbbmemStore(...)),langmem.create_manage_memory_tool, andlangmem.create_search_memory_tool.packages/langgraph-python/README.mddocumenting install-from-source, IC-1 namespace tuple mapping, middleware/tools, and0.2.0SDK / TTL / scan limits.Nothing published.
Acceptance Commands
Test Summary
ruff check packages/langgraph-python->All checks passed!(exit 0)ruff format --check packages/langgraph-python->11 files already formatted(exit 0)pytest -v packages/langgraph-python/tests packages/python/tests conformance/tests-> 128 passed, 0 failed (includingInMemoryStoreside-by-side parity, IC-1 mock conformance,ebbmem-client0.2.0SDK adapter path,create_agentmiddleware with mocked chat models,langmem.create_memory_store_managerwith mocked models, andconformance/tests/test_public_compliance.py)ebbmem-conformance --mode mock-> 21/21 passed (exit 0)Architecture Review Note
ebbmem-langgraphpackage off freshorigin/main(8b7aaf43, 13 files underpackages/langgraph-python/, max 876 lines, zero edits topackages/python/orconformance/, DCO sign-off).EbbmemStoreimplements the full async/sync LangGraphBaseStorecontract (abatch/batch,aput/put,aget/get,adelete/delete,asearch/searchwith semantic query and operator filters,alist_namespaces/list_namespaces,supports_ttl=False) with zero process-local item dictionary, IC-1 namespace mapping (avoiding per-tuple EbbMem namespace explosion), soft-tombstoneforgeton delete, and explicit fallback/strict handling forebbmem-client0.2.0 capability gaps.EbbmemMemoryMiddleware(sync + asyncwrap_model_callforcreate_agent) and LangMem-compatiblemanage/search/reinforcetools enforce read-only recall,<ebbmem_untrusted_memory_context>framing, explicit post-use reinforcement (injected=Falsedefault), secret redaction, and fail-open behavior.ruff checkandruff format --checkclean,pytest -v packages/langgraph-python/tests conformance/tests/test_public_compliance.py14/14 passed (coveringInMemoryStoreparity, IC-1 mock conformance, 0.2.0 SDK adapter path,create_agentmiddleware, andlangmem.create_memory_store_managerwith mocked models), README links verified. Nothing published.Follow-ups
ebbmem-clientpublishes P0-09 exact-key (get_by_key,delete_by_key), server-sidemetadatafilter,list_namespaces, andRecallRequestModelfilter/limit parity (andebbmem-integration-coreupdatesStdlibHttpTransport/EbbmemClientSdkAdapterincludingMemoryRowdeserialization), updateebbmem-integration-coresoEbbmemStoreleverages native server-side exact-key lookup and metadata filtering withoutscan_limitfallback.packages/langgraph-pythontest job to.github/workflows/ci.yml(ci.ymlleft untouched per shared-file rules).