Skip to content

Context scoping, sensitivity, and entity linking for knowledge #577

@kovtcharov

Description

@kovtcharov

Summary

Implement the three cross-cutting features that make memory useful for a PC assistant: context scoping (work vs personal), sensitivity classification (private data protection), and entity linking (people, apps, services).

Spec: docs/spec/agent-memory-architecture.md → "Context Scoping", "Sensitivity Classification", "Entity Linking"

Depends on: #542 (MemoryStore)

Context Scoping

Separate knowledge by life domain. System prompt only loads active context + global.

  • context column on knowledge + conversations (default: 'global')
  • init_memory(context="work") sets active context
  • set_memory_context("personal") switches mid-session
  • System prompt: global + active context items
  • Dedup scoped to context
  • remember() defaults to active context (overridable)
  • recall() searches all contexts by default (filterable)

Predefined: global, work, personal. User-defined: any string (project-x, learning, etc.)

Sensitivity Classification

Protect private data from leaking into system prompt or logs.

  • sensitive INTEGER column (0/1, default 0)
  • sensitive=1: excluded from system prompt, returned only via explicit recall()
  • Tool history: args redacted to keys only for sensitive operations
  • Dashboard: 🔒 badge, content blurred until clicked

Entity Linking

Associate knowledge with people, apps, services using lightweight type:name tags.

  • entity TEXT column (e.g., 'person:sarah_chen', 'app:vscode', 'project:gaia')
  • get_by_entity() — indexed lookup for "everything about X"
  • recall(entity="person:sarah_chen") — all facts about Sarah
  • Multiple knowledge entries can share an entity (builds profile over time)
  • No separate entity table — denormalized tag on knowledge rows

Acceptance Criteria

  • Context column on knowledge and conversations
  • System prompt filters by active context + global
  • Sensitive items excluded from system prompt
  • Sensitive items returned via explicit recall
  • Entity linking works with type:name convention
  • get_by_entity returns all linked knowledge
  • Dedup respects context boundaries
  • Dashboard filters work for all three features

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:agent-coreFramework, tools, registry, memory, skills, orchestrationtrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions