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

# Projects and sessions

> How projects set the scope of memory, and how sessions organise conversations.

EDN has two ways to organise memory:

* A **project** decides **which memory is used**.
* A **session** groups the messages of **one conversation**.

## Projects

A **project** is a separate scope of memory, such as one client, one product
or one document set. Memory saved into a project is used only when a request
names that project.

In the Console, each project appears as a **workspace**.

### Create a project

```bash theme={"theme":"github-light"}
curl https://api.tensorpro.ai/api/v1/projects \
  -H "Authorization: Bearer $EDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Website redesign"}'
```

The response includes the project's `id`. Use it as `project_id` in later
requests.

### How project scope works

You set the scope **on each request** with `project_id`:

| Request | Without `project_id` | With `project_id` |
| - | - | - |
| Save memory (`memory/ingest`, `document/ingest` and so on) | Saved to **general memory** | Saved **inside that project** |
| Build a SIP or search (`sip/build`, `search`) | Uses **general memory only**, never project memory | Uses **that project's memory**. Add `include_global: true` to include general memory too |

### Manage projects

* **List** your projects with `GET /api/v1/projects`.
* **Rename** a project with `PATCH /api/v1/projects/{project_id}`.
* **Delete** a project with `DELETE /api/v1/projects/{project_id}`. After that,
  requests that use its `project_id` return 404. The project's memories and
  documents are not deleted; to remove a document and everything EDN saved
  from it, [remove the document](https://docs.tensorpro.ai/api-reference/remove-project-source.md) first.

See the [API Reference](https://docs.tensorpro.ai/api-reference/overview.md) for request and response
details.

## Sessions

A **session** is one conversation. You choose a `session_id` and reuse it for
every turn in the same conversation.

* Use 1 to 128 characters: letters, digits, period (`.`), underscore (`_`),
  colon (`:`) and hyphen (`-`). A UUID works well.
* EDN creates the session the first time you use a new `session_id`.
* Session IDs belong to your account. Another account using the same value
  gets its own, separate session.

### Saving messages

Messages and memory are different things:

| | Saved with | What it is |
| - | - | - |
| **Memory** | `memory/ingest` | Information EDN remembers and can place in a SIP |
| **Messages** | `POST /api/v1/sessions/{session_id}/messages` | The conversation transcript. Never placed in a SIP |

To save a message to the transcript:

```bash theme={"theme":"github-light"}
curl https://api.tensorpro.ai/api/v1/sessions/YOUR_SESSION_ID/messages \
  -H "Authorization: Bearer $EDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"role": "user", "content": "Who manages the website project?"}'
```

Saved messages can also help with short follow-up questions. If a question on
its own, such as "and who approves it?", finds no relevant facts, EDN retries
the search once using the user's recent saved messages.

### Manage sessions

* **List** sessions with `GET /api/v1/sessions`. Filter by `project_id`, or
  search titles with `q`.
* **Rename** a session with `PATCH /api/v1/sessions/{session_id}`.
* **Read its messages** with `GET /api/v1/sessions/{session_id}/messages`.
* **Delete** a session with `DELETE /api/v1/sessions/{session_id}`. The session
  and its messages are removed from lists and reads immediately. Memory saved
  during the session is kept.

### Associating a session with a project

`PATCH /api/v1/sessions/{session_id}/project` associates a session with a
project. This is mainly organisational, for example so the Console shows the
session inside that workspace.

Associating the session with a project does not itself control which memory a
request uses. Memory scope is still set by `project_id` on the relevant memory
or SIP request.

## Memory ownership and end users

All memory, projects and sessions belong to the EDN account associated with
your API key. Projects and sessions organise memory within that account; they
do not currently create separate memory boundaries for each end user of your
application.

If your application serves multiple end users, your integration must make sure
their memory is kept isolated, rather than treating one EDN account as a shared
user-memory pool.

## Next steps

> [card] [The SIP](https://docs.tensorpro.ai/concepts/sip.md)
>
> How project builds and citations work.

> [card] [Memory records](https://docs.tensorpro.ai/concepts/memory-records.md)
>
> What gets saved.

> [card] [API Reference](https://docs.tensorpro.ai/api-reference/overview.md)
>
> The project and session endpoints.


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