AI Memory and Embeddings

Internal reference for Copilot conversation memory, workspace semantic memory, embeddings, indexing, and backfill strategy.

AI Memory and Embeddings

Copilot has two different memory concepts:

  • Conversation memory.
  • Workspace semantic memory.

They solve different problems and should not be treated as the same thing.

Conversation Memory

Conversation memory stores chat threads and messages so the user can resume a discussion.

Use conversation memory for:

  • Recent user intent.
  • Follow-up questions.
  • Draft refinement.
  • Preserving assistant responses.

Conversation history should be summarized or windowed before sending to the model. Do not send unlimited full history.

Workspace Semantic Memory

Workspace semantic memory stores embeddings for searchable business records.

Use semantic memory for:

  • Finding records by meaning.
  • Supporting global search.
  • Giving Copilot broader recall across records.
  • Matching user phrases to project, task, account, invoice, contact, resource, expense, and credit note context.

Structured tools still win when exact current state is required.

Indexed Entity Types

The workspace embedding index should include:

Entity typeKnowledge captured
ProjectName, account, status, health, dates, owner, summary, budget signals.
TaskTitle, project, status, priority, dates, assignee, description.
AccountCustomer name, billing info, status, owner, related context.
ContactName, email, account, role, contact details.
ResourceTeam member profile, role, teams, skills, capacity signals.
InvoiceNumber, account, status, due date, amount, billing summary.
Expense reportTitle, status, submitter, project/account, amount, category signals.
Credit noteNumber, account, status, amount, invoice relationship, reason.

Future ingestion should also include:

  • Assets and portal documents.
  • Status updates.
  • Comments where visibility allows.
  • Automation rules.
  • Settings documentation.
  • Product documentation.

Indexing Strategy

Use both backfill and event-driven indexing.

MethodUse it for
Backfill scriptInitial indexing and repair.
Event bus listenerKeeping embeddings current when records change.
Delete handlingRemoving deleted or inaccessible records from memory.

When a record is created, updated, archived, restored, or deleted, publish an embedding event. The listener should index or delete the entity as needed.

Document Shape

Each embedding document should include:

  • Organization id.
  • Entity type.
  • Entity id.
  • Content kind.
  • Human-readable content.
  • Content hash.
  • Embedding model.
  • Metadata.

Content should be concise and readable. It should include product terms users naturally search for.

Search Rules

Semantic search should:

  • Be scoped to the organization.
  • Respect entity-type filters.
  • Return readable snippets.
  • Include similarity.
  • Avoid returning records the user cannot access.
  • Prefer exact record resolution when the prompt includes a known number or name.

Product Documentation Ingestion

The docs in /docs should also be indexed as product knowledge. This lets Copilot answer "how do I..." questions using TDCFlow concepts instead of generic PSA advice.

Product docs should be stored separately from workspace records with a doc or product_knowledge entity type, so Copilot can distinguish:

  • Product behavior.
  • Customer workspace data.
  • Conversation context.