Skip to content

feat: implement powermem langchain middleware - #1187

Closed
kazmiller0 wants to merge 1 commit into
oceanbase:vldb_2026from
DBSchool:vldb_2026
Closed

feat: implement powermem langchain middleware#1187
kazmiller0 wants to merge 1 commit into
oceanbase:vldb_2026from
DBSchool:vldb_2026

Conversation

@kazmiller0

Copy link
Copy Markdown
  • before_agent/abefore_agent search PowerMem using the latest user message and inject retrieved memories as a SystemMessage
  • after_agent writes back the user/assistant exchange via memory.add, gated on save_interactions
  • explicit user_id threaded through all PowerMem calls
  • fail-open: search failures are logged and swallowed so the agent still runs
  • async path delegates to the sync implementation since PowerMem's Memory client is sync and LangGraph's RunnableCallable supports sync-only hooks under async execution

Summary

Solution Description

- before_agent/abefore_agent search PowerMem using the latest user
  message and inject retrieved memories as a SystemMessage
- after_agent writes back the user/assistant exchange via memory.add,
  gated on save_interactions
- explicit user_id threaded through all PowerMem calls
- fail-open: search failures are logged and swallowed so the agent
  still runs
- async path delegates to the sync implementation since PowerMem's
  Memory client is sync and LangGraph's RunnableCallable supports
  sync-only hooks under async execution
@CLAassistant

CLAassistant commented Jul 17, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@LINxiansheng

Copy link
Copy Markdown
Member

LangChain Contract Score

LangChain Contract Score
========================
score: 100.00 / 100
suites: 2
rule: A weighted capability receives credit only when it passes on every configured Python suite and all declared prerequisite capabilities also receive credit. Gate tests are reported but do not add points.

Public import contract: PASS (gate)
  py311: passed
  py312: passed
Retrieve memory before model call: PASS (35/35)
  py311: passed
  py312: passed
Persist interaction after agent run: PASS (25/25)
  py311: passed
  py312: passed
Disable interaction persistence: PASS (10/10)
  py311: passed
  py312: passed
Fail-open on search error: PASS (15/15)
  py311: passed
  py312: passed
Async memory injection: PASS (15/15)
  py311: passed
  py312: passed

LangChain Contract Report

LangChain Contract Report
=========================
score: 100.00 / 100
rule: A weighted capability receives credit only when it passes on every configured Python suite and all declared prerequisite capabilities also receive credit. Gate tests are reported but do not add points.

Suite Summary
-------------
py311: passed=6/6, failures=0, errors=0, skipped=0
py312: passed=6/6, failures=0, errors=0, skipped=0

Gate Checks
-----------
Public import contract [gate] PASS
  - py311: passed
  - py312: passed

Weighted Breakdown
------------------
Retrieve memory before model call [35/35] PASS
  - py311: passed
  - py312: passed
Persist interaction after agent run [25/25] PASS
  - py311: passed
  - py312: passed
Disable interaction persistence [10/10] PASS
  - py311: passed
  - py312: passed
Fail-open on search error [15/15] PASS
  - py311: passed
  - py312: passed
Async memory injection [15/15] PASS
  - py311: passed
  - py312: passed

Workflow run

@Teingi

Teingi commented Jul 24, 2026

Copy link
Copy Markdown
Member

Thank you for participating in the VLDB Summer School. Now that the program has concluded, we’re closing this PR as part of the event wrap-up. We appreciate the time and effort you put into your contribution.

@Teingi Teingi closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants