> ## Documentation Index
> Fetch the complete documentation index at: https://www.sapientpriors.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# A meeting notetaker

> An app that learns meetings as they happen and answers questions about them, during the meeting and after it.

## Example use case

Your app joins a user's meetings, learns the transcript as people speak, and answers questions by voice or in chat: during the meeting about the last few minutes, and afterwards about every meeting it has heard. "What did Rahul agree to last Tuesday?" and "What are my tasks this week?" both work.

## Set up

* **One project** for the app, with a **service account** that holds the Project admin role, so your code can create and delete agents. See [Set up your organization](https://www.sapientpriors.com/docs/walkthroughs/set-up-your-organization.md).
* **One agent per user.** It holds all of that user's meetings, so they can ask across every meeting. Store the `agent_id` on your user record.
* **One thread per meeting.**
* Send `X-SP-End-User` with your user's id on every call made for that user.

Optional: **one agent per meeting series**, such as a weekly standup or one client's calls, which carries what earlier meetings agreed into the next one. A meeting in a series can go to the series agent and to the user's own agent. Each agent learns it separately.

Create the agent when a user turns the notetaker on, then poll [GET`/v2/agents/{agent_id}`](https://www.sapientpriors.com/docs/api-reference/v2/agents/get-agent) until `status` is `ready`:

```json theme={null}
{
  "agent_config": {
    "role": "Meeting notetaker for Ada",
    "objective": "Remember what was discussed, decided, and assigned in Ada's meetings, who said it, and when, so questions about the current meeting and earlier ones get exact answers.",
    "metadata": { "user_id": "u_4471" }
  }
}
```

The objective decides what the agent keeps, so make it specific to the outcome you want. `metadata` is stored and returned, but it is not searchable.

## Flow 1: start a meeting

Recording is opt-in per meeting. When the user starts the notetaker, create the meeting's thread with [POST`/v2/agents/{agent_id}/threads`](https://www.sapientpriors.com/docs/api-reference/v2/threads/create-thread). Give it a title with the meeting name and date. The thread is ready at once. A meeting that the notetaker never joins leaves nothing in memory.

## Flow 2: learn the transcript as it is spoken

Every one to two minutes, send the new transcript lines to the meeting's thread with [POST`.../observe`](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-messages-or-files), oldest first:

```json theme={null}
{
  "content": [
    { "text": "Let's move the launch to the 15th.", "speaker": "Asha", "speaker_id": "u_2210", "timestamp": "2026-12-04T10:06:12Z" },
    { "text": "Fine, I'll update the plan.", "speaker": "Rahul", "timestamp": "2026-12-04T10:06:20Z" }
  ]
}
```

* Send the transcript, not a summary. A summary loses who said what and the corrections people made along the way.
* Set `timestamp` to when each line was said.
* Send `Idempotency-Key: <meeting id>-<batch number>`, so a retried batch is never learned or billed twice.
* Poll [GET`.../observe/{observation_id}`](https://www.sapientpriors.com/docs/api-reference/v2/threads/get-learning-status) until `committed` before you send the next batch to the same agent. An agent learns one batch at a time. See [Ordering of learning](https://www.sapientpriors.com/docs/integration.md#ordering-of-learning).

When the meeting ends, you can send your own summary and action items as one more `observe` on the same thread, with `speaker` set to the notetaker and the meeting's end time as `timestamp`. The transcript stays the source. The summary helps with questions such as "what are my tasks".

## Flow 3: answer questions

| Where | Call | Why |
| - | - | - |
| By voice, during the meeting | [POST`.../respond`](https://www.sapientpriors.com/docs/api-reference/v2/threads/answer) on the meeting's thread, with `stream: true` and `detail: "brief"` | The question is already in the transcript, so it need not be learned again. Start speech on the first `delta` event. |
| In chat, during the meeting | `respond` on the meeting's thread | The answer also sees the last few minutes of the meeting. |
| In chat, outside meetings | `respond` on one chat thread per user | |
| A typed correction that should stick, such as "my deadline moved to Friday" | [POST`.../observe-and-respond`](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-and-answer) with `learn_reply: false` | Learns what the user said, not the answer. |
| Context for your own model or agent | [POST`.../recall`](https://www.sapientpriors.com/docs/api-reference/v2/threads/recall-memories) | Returns the relevant dated memories, with who said each one, for your model's prompt. |

## Flow 4: delete a meeting

* **Close the meeting, keep what was learned:** delete the thread with [DELETE`.../threads/{thread_id}`](https://www.sapientpriors.com/docs/api-reference/v2/threads/delete-thread).
* **Make the notetaker forget the meeting:** list its memories with [GET`/v2/agents/{agent_id}/memories`](https://www.sapientpriors.com/docs/api-reference/v2/memories/list-memories) and `thread_id`, delete each with [DELETE`.../memories/{turn_id}`](https://www.sapientpriors.com/docs/api-reference/v2/memories/forget-a-memory), then delete the thread.
* **Remove a user:** [DELETE`/v2/agents/{agent_id}`](https://www.sapientpriors.com/docs/api-reference/v2/agents/delete-agent) removes the agent's threads, memories, files, and logs. It cannot be undone.

## What goes wrong

> [!WARNING]
>
> Deleting a thread keeps the memories made from it. A user who asks you to forget a meeting expects its content gone: delete the memories first, then the thread.

* **Batches sent out of order or in parallel to one agent:** the second one waits behind the first. Wait for `committed` before you send the next batch.
* **No `speaker` or `timestamp`:** the agent cannot say who decided what, or when.
* **No `X-SP-End-User`:** every call acts as the service account, and all your users share one rate-limit window.

## Calls used

* Guides: [Service accounts](https://www.sapientpriors.com/docs/access/service-accounts.md), [Learning](https://www.sapientpriors.com/docs/concepts/learning.md), [Answering](https://www.sapientpriors.com/docs/concepts/answering.md), [Memories](https://www.sapientpriors.com/docs/concepts/memories.md)
* API reference: [Create agent](https://www.sapientpriors.com/docs/api-reference/v2/agents/create-agent.md), [Create thread](https://www.sapientpriors.com/docs/api-reference/v2/threads/create-thread.md), [Learn messages or a file](https://www.sapientpriors.com/docs/api-reference/v2/threads/learn-messages-or-files.md), [Answer](https://www.sapientpriors.com/docs/api-reference/v2/threads/answer.md), [Recall memories](https://www.sapientpriors.com/docs/api-reference/v2/threads/recall-memories.md), [Forget a memory](https://www.sapientpriors.com/docs/api-reference/v2/memories/forget-a-memory.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.