# How summaries arise

> Summaries are written by your own AI, on request, and not by a language model of Enterprise Ego.

Enterprise Ego has no language model of its own. That is why there are no extra AI costs, and why a summary is only written when someone asks for it.

## The flow

1. Conversations arrive in your storage and get a line in the journal of each context they belong to.
2. An administrator asks their AI to open a context with `open_context`. The AI reads the summary, the memory and the recent journal.
3. When the administrator asks for it, the AI writes a new summary with `write_file`, to `README.md` of that context.
4. The previous version is kept as `README.prev.md`.

A summary has three parts: a summary, agreements and decisions, and open questions. The first version of a new context says that it has not been written yet.

## Facts and agreements

A single fact or agreement goes into `memory.md` of the context with `remember`. Each line gets a date and the user. The memory file holds at most 50,000 characters. When it is full, the AI should write a summary in `README.md` and an administrator cleans up `memory.md`.

## Session summaries

A short summary of a work session goes in `context/users/<name>/sessions/yyyy-mm-dd-topic.md`, when an administrator asks for it. A next session can continue from it.

## Why on request

The write tools only work when the person in the conversation asked for it. The AI has to pass that request, verbatim, in the parameter `admin_request`. Without such a request the server refuses to write. See [Protocol and limits](https://enterpriseego.cafeboon.com/docs/reference/protocol).
