Skip to content

feat: Add people and relationship memory #72

@QueryPlanner

Description

@QueryPlanner

Priority: Medium

Level of Effort: Large (5-8 days)

Summary

Add a people/relationship memory system that lets the agent remember information about people mentioned by the user. This goes beyond generic memory — it should track personal details, relationship context, and conversation notes about specific individuals.

Scope

  • New module: src/blacki/people/
  • Storage: PostgresPeopleStorage (table: people, extends PostgresStorage base)
  • Data model:
    • name (str, required)
    • relationship (str, optional — e.g., "coworker", "friend", "family")
    • context / notes (str, JSONB — flexible structured notes)
    • tags (list[str] — for categorization)
    • first_mentioned (datetime, auto-set)
    • last_updated (datetime, auto-updated)
  • Tools:
    1. remember_person — add or update a person record with details
    2. search_people — semantic search or keyword search across stored people
    3. get_person — retrieve full details for a specific person by name
    4. list_people — list all known people, optionally filtered by relationship/tag
    5. delete_person — remove a person record
  • Vector integration (optional/phase 2): Use the existing Mem0/Qdrant vector store for semantic search across people notes
  • Pattern: Follow existing storage + tools patterns from calories/ and workouts/

Sources

  • Existing memory tools: src/blacki/memory/tools.py
  • Storage base class: src/blacki/storage/base.py
  • Calorie storage pattern: src/blacki/calories/storage.py
  • Calorie tools pattern: src/blacki/calories/tools.py
  • Workout storage: src/blacki/workouts/storage.py
  • Tool registry: src/blacki/registry.py
  • DI container: src/blacki/container.py
  • Memory config (vector store setup): src/blacki/memory/config.py
  • AGENTS.md tool design principles

Passing Criteria

  • uv run ruff check passes with no errors
  • uv run ruff format passes with no changes needed
  • uv run mypy . passes with no errors
  • uv run pytest tests/people/ --cov=src/blacki/people passes with 100% coverage on people module
  • uv run pytest full suite passes
  • remember_person correctly stores and updates people records scoped to user_id
  • search_people returns relevant results by name or keyword
  • get_person returns full record including all stored fields
  • list_people supports filtering by relationship type and tags
  • delete_person removes the record and returns confirmation
  • Storage is properly initialized via AppContainer and registry.py
  • All tools gracefully handle missing/empty data with clear error messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions