Skip to content

feat(recall): add bounded atomic memory manifest - #2192

Open
Tech-Circle-48 wants to merge 21 commits into
oceanbase:masterfrom
Tech-Circle-48:s3
Open

Tech-Circle-48 wants to merge 21 commits into
oceanbase:masterfrom
Tech-Circle-48:s3

Conversation

@Tech-Circle-48

@Tech-Circle-48 Tech-Circle-48 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1864

Rationale for this change

Agents currently need to retrieve memory content before deciding which entries are useful. A bounded, metadata-only manifest provides a cheaper first step, allowing agents to select entries before fetching their full content.

What changes are included in this PR?

  • Add a paginated Atomic Memory recall manifest through HTTP, MCP, and the Python client.
  • Store descriptions with memory revisions and their current search projections.
  • Generate descriptions alongside text during extraction and reconciliation.
  • Preserve model-free explicit writes by storing a bounded, single-line text preview when no description is supplied.
  • Update integration bindings, migration compatibility, documentation, and regression tests.

Are there any user-facing changes?

  • Add POST /v1/recall/manifest and get_recall_manifest.
  • This initial implementation covers active Atomic Memory only.
  • Callers may supply an optional description. Omitting it does not require an LLM.
  • Manifest reads return metadata without reading memory bodies or invoking models.
  • Historical memories without descriptions remain readable; their manifest descriptions may be null.
  • Manifest pagination defaults to 50 entries, with a maximum of 100.

How was this change tested?

  • make check
  • Python and JavaScript API generation consistency checks.
  • HTTP/MCP contract tests.
  • Non-Desktop Python regression suite: 6,175 passed, with 10 working-directory-dependent tests passing on rerun from the repository root; 593 skipped.
  • Dify and OpenDAL integration checks.
  • DSH unit and end-to-end tests, plus build reproducibility verification.
  • Manual Postman verification of memory writes and manifest responses.

AI usage statement

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tagged manifest path rejects valid input, and the Desktop and skill-validation contracts need to be synchronized. Details inline.

Comment thread src/powercontext/server/atomic_memory.py
Comment thread desktop/ui/src/generated/api.d.ts
Comment thread src/powercontext/server/mcp.py
Comment thread src/powercontext/builtin/runtime/composition.py Outdated
Comment thread src/powercontext/builtin/artifacts/atomic_memory/extraction.py Outdated
@Tech-Circle-48
Tech-Circle-48 requested a review from frf12 as a code owner October 22, 2026 10:10

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked at 080b2d2. The tag conversion and skill catalog fixes pass. A manifest pagination issue remains below; the Desktop contract mismatch is still reproducible and is followed up in its original thread.

Comment thread src/powercontext/builtin/runtime/atomic_memory.py Outdated
@Tech-Circle-48
Tech-Circle-48 force-pushed the s3 branch 2 times, most recently from a36e595 to 530b99c Compare October 23, 2026 02:20

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One remaining cursor-binding issue at 30a35db; details inline.

Comment thread src/powercontext/builtin/runtime/atomic_memory.py Outdated

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Resolve merge conflicts with the target branch.

@AlexStocks AlexStocks added the 1.4.1 v1.4.1 release tracking label Oct 24, 2026
text="validation",
description="validation",
)
mode, vector, query_embedding, embedding_calls = await self._resolve_query_embedding(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] search() 的解包元数与 _resolve_query_embedding 的返回值不一致,所有检索调用在运行期直接抛 ValueError

7cb90431(Merge branch 'master' into s3,父提交 8f44c20f + 1da99747)的冲突解析把 master 侧的五元返回截成四元:本行删掉了 embedding_fallback,但同文件 _resolve_query_embedding 在该 head 仍返回 5 项(return "text", None, None, 0, _fallback_reason(exc) / return mode, vector, MemoryQueryEmbedding(...), 1, None 等)。

触发条件与影响:ScopedAtomicMemory.search() 的每一次调用都会在解包处失败,覆盖 HTTP POST /v1/atomic-memory/search、MCP 检索工具、Python client 与内部 recall 链路,属核心读路径整体不可用。

证据:

  • 本地 exact head 树(7cb90431)跑本 PR 新增用例:pytest tests/e2e/test_recall_manifest.py → 1 failed: ValueError: too many values to unpack (expected 4),栈顶即 runtime/atomic_memory.py:590。
  • 同一 head 的 CI tests (3.11, unit)(job 120817133346)日志出现 63 次 ValueError: too many values to unpack (expected 4),例如 FAILED tests/builtin/artifacts/atomic_memory/test_forgetting.py::test_atomic_forgetting_preserves_history_tags_and_current_projection[sqlite]、FAILED tests/builtin/persistence/test_memory.py::test_sqlite_memory_backend_commits_authoritative_history_and_fts;该 head 当前 32 个红 check(含 tests (3.1x, unit/e2e)、quality、Acceptance (sqlite/oceanbase))。

同一处合并还留下第二个缺口::675 仍以 embedding_fallback=embedding_fallback 传给 _rerank,而唯一的赋值已被本行删除 ⇒ 即使只把解包改成 _,该关键字要么继续引用未绑定名字(NameError),要么被顺手删掉从而丢失 master 的 RFC 1435 fallback_reason 上报。

建议:恢复 mode, vector, query_embedding, embedding_calls, embedding_fallback = await self._resolve_query_embedding(...),保留 _rerank(..., embedding_fallback=embedding_fallback) 的传递;并补一条断言检索结果带有 fallback 原因(memory.search.embedding_fallback)的用例,本次合并把该路径的覆盖一并丢了。合并后请重跑 tests/e2e/test_recall_manifest.py 与 unit 选择集确认转绿。

@hidb4ai hidb4ai added 1.5.0 v1.5.0 release tracking and removed 1.4.1 v1.4.1 release tracking labels Oct 24, 2026
@AlexStocks

Copy link
Copy Markdown
Contributor

@Tech-Circle-48 please fix the file confliction and ci failure.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.0 v1.5.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(recall): add a manifest read path for two-stage bounded recall

4 participants