Most of what a team knows is already written down, in a folder on somebody's
computer: PDFs, Word files, old exports, years of notes. A workspace can hold all
of it, and answer from it, if it gets in there first. This page is that move.

The honest split, before anything else:

- **A handful of files**, up to about thirty: drop them into the workspace's chat
  and ask it to file them. Ten files per message, up to 100 MB each.
- **A folder of hundreds or thousands**: point your own AI at it. A thousand
  documents is thousands of pages of text, and your AI reads them on your own plan
  rather than the workspace's credit.

## Why your own AI, and not the chat

A chat reply stops after ten minutes, and a browser tab cannot open a folder on
your disk. So a folder of a thousand files is a hundred small turns in a chat, or
one sitting with an AI that already has the folder in front of it.

Claude Code and Codex run on your computer, right beside the folder, and both
connect to a workspace. They read the files on your own plan, write the pages
straight into Memory, and finish in one sitting instead of a hundred. The
workspace pays only to index what arrives.

## Point your AI at the folder

1. **Have the folder where your AI can read it.** Its own computer. A browser chat
   cannot open a folder on your disk.
2. **Connect your AI to the workspace, with Read & Write**, so it can save what it
   reads:

   - **Claude Code**: `claude mcp add --transport http --scope user gbrain https://gbrain.io/mcp`,
     then run `/mcp`, pick `gbrain` and choose Authenticate.
   - **Codex**: `codex mcp add gbrain --url https://gbrain.io/mcp`.
   - Anything else: [Connect an AI](/docs/tools/assistants).

3. **Paste the prompt below**, with the folder's path and a name for the
   collection in place of the two placeholders.

A collection is just the name your documents are filed under in Memory, and you
choose it: `quorum-docs`, `lab-notebooks`, `2024-proposals`. Two different folders
get two names, and nothing collides.

```
Read every document in <folder> into my GBrain memory, as the collection
<collection>.

Work in batches of up to 25 documents and keep going until you have been through
the whole folder. For each document:

1. Read its text. If you cannot read it — a scan with no text in it, an
   encrypted or corrupt file, or a format you have no way to open — do not file
   it. Note its path and the reason, and carry on.
2. Write one page per document at this address, and nowhere else:
   sources/<collection>/<the document's path under the folder, keeping the /
   between subfolders, lowercased, its file extension dropped, with spaces and
   other punctuation inside each name turned into dashes>. A page is stored at
   <address>.md, so the address never carries the file's own extension. If two
   documents would land on the same address, add a dash and six characters of
   the file's sha256 to the end of it.
3. The page holds the document's whole text, not a summary, under a heading with
   the document's own name, and it opens with two lines of its own record,
   source_path: <the document's path exactly as it is on disk> and
   source_sha256: <the file's sha256>.
4. A document too long for one page gets one page per section, at
   <address>/part-01, <address>/part-02 and on, each with the same source_path
   and source_sha256.
5. Write with the GBrain tools — put_pages for a batch, put_page for one — and
   never by editing files on disk. Write nothing outside sources/<collection>/.

Before you start, list every page already in memory under sources/<collection>/
with list_pages and page through that list until it ends. Skip any document whose
address is already there, unless the file on disk changed after that page's
updated_at: for a newer file, read the page with get_page, and if its
source_sha256 differs from the file's sha256, replace it with put_page using the
revision get_page returned. That is how you resume: if you are interrupted, I run
this same prompt again and you carry on from the folder, never from a count you
remember.

After every batch, tell me how many documents are in, out of how many the folder
holds: "412 of 1,003 documents in, 6 skipped". Count documents, not pages. A
document is only in when every page it needed committed; a page the batch refused
or failed is not in, so fix it or count it as skipped and give its error. A write
for an unchanged file that comes back saying the page already exists means that
document is already in: count it and carry on. When the folder is done, say what
you filed, what you skipped and why, and what is left. Never delete anything from
memory.
```

**Stop it after the first batch, then start it again.** Watch the first twenty or
so come in, check a page in **Memory → Sources**, then run the exact same prompt
and confirm it skips what is already filed and carries on from the next file. Two
minutes now is the difference between trusting it with a thousand documents and
discovering the problem at file 900.

## When it stops

It will stop sometimes: a closed laptop, a session limit, a bad PDF. Nothing is
lost and nothing is filed twice. Run the same prompt again. The first thing it
does is list what memory already holds under the collection, so it carries on from
the folder rather than from a count it remembers.

- **A document changed** and was run again: it is filed again. The AI reads the
  page it wrote before, sees the file's digest has moved, and replaces it, so you
  get the new version rather than a second note.
- **A document was deleted from the folder**: nothing happens to memory. An import
  never deletes.
- **The folder grows**: run the same prompt later. Only what is new gets filed.

## Check it worked

Ask the AI that ran it, "how many documents from that folder are in memory?" It
answers from two numbers: how many files the folder holds on your computer, and
how many documents memory holds under `sources/<collection>/`, counting a
multi-part document as one. Both, not a tally from memory of doing the work. The
workspace itself can answer the second half.

In the workspace, **Memory → Sources → your collection's name** lists every
document. Open one: its text is there, under the document's own name.

## What it costs

Your AI reads the files on your own plan or API key, and the workspace pays only
to index the pages that arrive, a fraction of a cent per document.

The model is the lever, on your own plan as much as on the workspace's. A real
pass over a thousand average documents reads, writes and checks each file in
batches, so it lands roughly here:

- **$4 to $8** on a small model, like Haiku, GPT-6 Luna or Particle-1.
- **$40 to $80** on a mid-sized one, like Sonnet or Sol.
- **$80 to $160** on a frontier model like Opus. On a flat subscription, a model
  that expensive usually hits a session limit partway through, where a small one
  finishes in a sitting.

So switch your AI to a small model before starting, and leave it there until the
folder is in.

## If you have no AI of your own

If the folder is already markdown and text files, zip it and drop the zip into the
workspace's chat, up to 100 MB per message: "unpack this and import the markdown
under `sources/<collection>`." For a bigger archive,
[Set up a terminal](/docs/tools/terminal) lets you copy it onto the workspace's
machine and run `gbrain import` in Shell, which checkpoints and resumes by itself.

Neither of those opens a PDF or a Word file. For those, drop up to thirty at a time
into the chat, or connect an AI.

## What stays on your computer

Memory keeps the words of each document, not the original PDF or Word file, so
keep the folder if you still want the originals. Scanned pages that are only a
picture are skipped and listed at the end rather than filed empty; run text
recognition on those first, or ask for help with the ones that came back skipped.