Skip to content

Client Profile Memory #65

Open
Open

Description

@vybe

Summary

Implement per-client structured memory that accumulates over time through agent interactions. Each agent builds a profile of each client it communicates with — preferences, communication style, past decisions, recurring requests — and this profile is injected into context on subsequent conversations.

Context

Current Trinity agents start every conversation from zero. A business agent that talked to a client last week about email campaigns has no recollection of that conversation's conclusions. Chat history exists in the database, but raw message logs are not the same as distilled client knowledge. This is the difference between a chatbot and a business partner.

Related existing issues:

This issue is specifically about structured client profiles, not general agent memory.

Requirements

Client Profile Schema

Per agent-client pair, maintain a structured profile:

client_id: "[email protected]"
agent_name: "sales-agent"
first_contact: "2025-01-15"
last_contact: "2025-02-20"
interaction_count: 47

preferences:
  communication_style: "concise, bullet points preferred"
  timezone: "EST"
  response_format: "summaries with action items"
  
learned_facts:
  - "Prefers invoices sent on Fridays"
  - "Email campaigns should use casual tone"
  - "Reports to VP of Marketing (Sarah)"
  - "Q2 budget approved for $50k"

active_context:
  current_projects:
    - "Q2 email campaign redesign"
    - "Website copy refresh"
  pending_decisions:
    - "Choose between Template A and B for newsletter"
  deadlines:
    - "Campaign launch: March 15"

interaction_summary:
  topics_discussed: ["email campaigns", "brand voice", "analytics"]
  decisions_made:
    - date: "2025-02-10"
      decision: "Switch to weekly newsletter cadence"
    - date: "2025-02-18"
      decision: "Use Template A for product announcements"

Profile Accumulation

  • After each conversation, the agent (or a post-processing step) extracts and updates the client profile
  • Extraction should be LLM-powered: summarize new facts, update preferences, note decisions
  • Profile updates are additive — new facts added, contradictions resolved (latest wins)
  • Rate-limited: don't re-process on every single message, batch per session close or periodically

Context Injection

  • When a client messages an agent (via any channel), inject a condensed profile summary into the system prompt
  • Token budget: profile summary should fit in ~500-1000 tokens
  • Include: key preferences, active projects, recent decisions, pending items
  • Exclude: full interaction history (that's what chat sessions are for)

Storage

  • Store profiles in agent filesystem (/home/developer/memory/clients/) for agent-local access
  • Mirror to platform database for cross-agent visibility and backup
  • Consider: should profiles be shared between agents owned by the same user? (configurable)

API Endpoints

  • GET /api/agents/{name}/clients — List known clients
  • GET /api/agents/{name}/clients/{email}/profile — Get client profile
  • PUT /api/agents/{name}/clients/{email}/profile — Manual profile update
  • POST /api/agents/{name}/clients/{email}/profile/extract — Trigger extraction from recent sessions
  • DELETE /api/agents/{name}/clients/{email}/profile — Clear profile

Acceptance Criteria

  • Client profile schema defined and documented
  • Profiles persist in agent filesystem and platform database
  • LLM-powered extraction updates profiles after session close
  • Profile summary injected into context for returning clients
  • API endpoints for CRUD operations on profiles
  • Profile injection works across channels (Slack, public chat, dashboard)
  • Profiles respect agent boundaries (agent A's profile of a client is separate from agent B's)

Non-Goals

  • No UI for browsing/editing client profiles (API-only for now)
  • No cross-agent profile sharing in MVP (flag it as future)
  • No vector/semantic search over profiles (see Vectorized Episodic Memory #39)

Activity

  1. added
    priority-p2
    type-feature
    on Mar 4, 2026
  2. vybe commented on Mar 30, 2026

    @vybe
    ContributorAuthor

    Actualization (2026-03-30)

    Current state: Partially addressed by MEM-001 (#147):

    • Per-user persistent memory for public links (MEM-001) — scoped to (agent_name, user_email), injected into every agent call, updated via background summarization every 5 messages
    • public_user_memory table stores structured text blobs per user-agent pair

    Gap vs. this issue:

    • MEM-001 is public-link only (not authenticated chat sessions)
    • No structured client profile schema (preferences, communication style, decisions)
    • No cross-agent profile sharing (each agent has independent memory per user)
    • No profile management UI

    Recommendation: Keep open. MEM-001 is a foundation. This issue's value is the structured profile concept (vs. raw text blob) and extending it to authenticated sessions.

  3. added
    complexity-medium
    theme-devex
    on Jun 3, 2026
  4. added
    status-incubating
    on Jun 14, 2026
  5. added
    complexity-high
    and removed
    complexity-medium
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-highpriority-p2status-incubatingtheme-devextype-feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions