Skip to content

feat: add scoped memory records and knowledge promotion#275

Closed
esafwan wants to merge 18 commits into
developfrom
feature/scoped-memory-core
Closed

feat: add scoped memory records and knowledge promotion#275
esafwan wants to merge 18 commits into
developfrom
feature/scoped-memory-core

Conversation

@esafwan
Copy link
Copy Markdown
Contributor

@esafwan esafwan commented May 27, 2026

Summary

Implements the first two development slices from the scoped memory / knowledge bridge plan:

  1. docs: add scoped memory and knowledge bridge RFC #274 core schema + tools

    • Adds Memory Record DocType as the canonical scoped memory/data layer.
    • Adds Memory Policy DocType for capture/retrieval/projection policy configuration.
    • Adds Desk actions for activating records, queueing knowledge projection, opening the generated Knowledge Input, and removing projection.
    • Adds permission-aware backend APIs/tool handlers for saving, searching, reading, archiving, and promoting memory records.
  2. docs: add scoped memory and knowledge bridge RFC #274docs: RFC for adapting Agno's knowledge/vectordb architecture into HUF #178 promote memory to knowledge

    • Adds optional promote_to_knowledge on Memory Record.
    • Projects active memory records into the existing Knowledge Input flow as Text inputs.
    • Keeps Memory Record as canonical source of truth; Knowledge Input is only the searchable projection.
    • Queues existing Knowledge Input processing so the current Knowledge Source indexing pipeline handles FTS/vector backends.

Key files

  • huf/huf/doctype/memory_record/
  • huf/huf/doctype/memory_policy/
  • huf/ai/memory_tools.py

Architecture note

This intentionally does not implement Hindsight-style learning yet. It creates the stable canonical layer first, then connects it to the existing Knowledge Source / Knowledge Input path.

This PR follows the order discussed in #274:

Memory/Data Record
→ Promote to Knowledge
→ Knowledge Input
→ existing Knowledge Source indexing

Related:

Testing

Not run in this environment.

Recommended validation after checkout:

bench --site <site> migrate
bench --site <site> clear-cache
bench build --app huf

Manual checks:

  1. Create a Memory Record with status = Active.
  2. Set Promote to Knowledge = 1 and choose a Knowledge Source.
  3. Click Queue Knowledge Projection.
  4. Confirm a Knowledge Input is created and queued/processed.
  5. Search the target Knowledge Source for the memory summary.

esafwan added 17 commits May 27, 2026 07:58
Tool wiring (sdk_tools.py + agent_tool_function.json):
- Add 5 native tool types: Save Memory Record, Search Memory Records,
  Get Memory Record, Archive Memory Record, Promote Memory to Knowledge
- Each maps to corresponding handler in huf/ai/memory_tools.py

Docs (docs/memory/):
- zero-to-hero.md: full onboarding guide capturing Agno/Hindsight/Mem0
  influences, how existing knowledge backends work, architecture diagrams,
  scope matrix, design decisions and reasons, glossary
- phase-plan.md: per-phase delivery plan (Phases 0-5) with definition of
  done, security model, backward compatibility notes, open questions
esafwan added a commit that referenced this pull request May 28, 2026
Three new documentation files covering the full memory architecture:

- docs/SCOPED_MEMORY_KNOWLEDGE_BRIDGE_RFC.md — Updated RFC reflecting current
  state: three live backends (sqlite_fts, sqlite_vec, chroma), Phase 1 implemented
  via PR #275, phases 2–5 defined with learning profiles and learning agents

- docs/memory/zero-to-hero.md — Full onboarding doc capturing intellectual
  provenance (Agno/Hindsight/Mem0 references), how existing knowledge backends
  work, the three-layer architecture, what exists today vs what is planned,
  key files, design decisions and their reasons, glossary

- docs/memory/phase-plan.md — Per-phase delivery plan with definition of done,
  file-level targets, cross-cutting concerns (security, testing, backward compat)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
esafwan added a commit that referenced this pull request May 28, 2026
Three new documentation files covering the full memory architecture:

- docs/SCOPED_MEMORY_KNOWLEDGE_BRIDGE_RFC.md — Updated RFC reflecting current
  state: three live backends (sqlite_fts, sqlite_vec, chroma), Phase 1 implemented
  via PR #275, phases 2–5 defined with learning profiles and learning agents

- docs/memory/zero-to-hero.md — Full onboarding doc capturing intellectual
  provenance (Agno/Hindsight/Mem0 references), how existing knowledge backends
  work, the three-layer architecture, what exists today vs what is planned,
  key files, design decisions and their reasons, glossary

- docs/memory/phase-plan.md — Per-phase delivery plan with definition of done,
  file-level targets, cross-cutting concerns (security, testing, backward compat)
esafwan added a commit that referenced this pull request May 28, 2026
…d phase plan

- Status changed from Discussion to Active
- Three live backends documented (sqlite_fts, sqlite_vec, chroma)
- Phase 1 (PR #275) marked implemented
- Phases 2-5 defined with learning profiles and learning agent design
- Reference architecture section added (Agno, Hindsight, Mem0)
- Points to new zero-to-hero and phase-plan docs in feature/scoped-memory-core

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@esafwan esafwan force-pushed the feature/scoped-memory-core branch from eba8bca to 3c9b5ce Compare May 28, 2026 23:08
esafwan added a commit that referenced this pull request May 28, 2026
…d phase plan

- Status changed from Discussion to Active
- Three live backends documented (sqlite_fts, sqlite_vec, chroma)
- Phase 1 (PR #275) marked implemented
- Phases 2-5 defined with learning profiles and learning agent design
- Reference architecture section added (Agno, Hindsight, Mem0)
- Points to new zero-to-hero and phase-plan docs in feature/scoped-memory-core
@esafwan
Copy link
Copy Markdown
Contributor Author

esafwan commented Jun 1, 2026

Superseded by the unified implementation in PR #282.

All the code and concepts from this PR have been integrated into that branch, alongside fully functioning background learning agents and hybrid search backends.

@esafwan esafwan closed this Jun 1, 2026
@Sanjusha-tridz Sanjusha-tridz deleted the feature/scoped-memory-core branch June 5, 2026 05:43
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.

1 participant