Skip to content

# Feature: Client Memory System (Persistent Intelligence per Client) #73

Description

@nerkat
## Goal

Add a **Client Memory system** that maintains persistent structured intelligence about a client across multiple calls.

Each new call analysis should generate a **memory patch** that updates the client's memory snapshot.

This allows the system to provide:

- Client context
- Recurring risks
- Decision style
- Budget signals
- Timeline signals
- Key people
- Briefing bullets for "Prep for Call"

This memory becomes the foundation for **deal intelligence across time**, not just per-call analysis.

---

# Architecture

We will introduce two data layers:

### 1. Call Analysis (already exists)

Each call already stores structured AI output.

We will reuse this.

---

### 2. Client Memory (new)

Single document per client.

Collection:

clientMemory/{clientId}


Structure:

```json
{
  "clientId": "string",
  "memoryTags": ["string"],
  "decisionStyle": "string",
  "budgetSignals": "string",
  "timelineSignals": "string",
  "recurringRisks": ["string"],
  "keyPeople": [
    {
      "name": "string",
      "role": "string | null",
      "notes": "string | null"
    }
  ],
  "briefingBullets": ["string"],
  "lastUpdatedAt": "timestamp"
}

Memory Update Flow

When a call analysis completes:

  1. Load existing client memory
  2. Generate a memory patch from the call analysis
  3. Merge patch into client memory
  4. Save updated memory document

Memory Patch Schema

AI should generate a patch object like:

{
  "newTags": ["string"],
  "riskSignals": ["string"],
  "peopleUpdates": [
    {
      "name": "string",
      "role": "string | null",
      "notes": "string | null"
    }
  ],
  "budgetSignal": "string | null",
  "timelineSignal": "string | null",
  "briefingUpdates": ["string"]
}

Merge Logic

When applying a patch:

Tags

Add new tags if not already present.

Risks

Append new recurring risks if relevant.

People

Merge by name:

  • update role/notes if provided
  • avoid duplicates

Budget / Timeline

If patch provides updated signal → replace previous.

Briefing Bullets

Keep max 5–8 bullets.

Replace older ones if new signal is stronger.


API

Add endpoint:

POST /api/update-client-memory

Input:

{
  clientId: string,
  callAnalysisId: string
}

Steps:

  1. Load analysis
  2. Load existing memory
  3. Generate memory patch (AI)
  4. Merge
  5. Save

Return updated memory.


UI Changes

On Client page:

Add Client Memory section showing:

  • Memory tags
  • Decision style
  • Recurring risks
  • Key people
  • Briefing bullets

Add button:

Refresh Memory

Triggers memory update.


Future Use

Client memory will power:

  • Prep for Call
  • Story So Far
  • Deal trajectory insights

Acceptance Criteria

  • Client memory document created automatically
  • Memory updates after each analyzed call
  • Patch merge prevents duplicates
  • Client page shows memory snapshot
  • No existing features break

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions