Questions

How do I turn my ChatGPT or Claude history into context for an AI agent?

Updated 2026-10-20

Your chat history shows a lot about how you think. You push back on some answers and accept others. Along the way, you explain your reasons. This page shows how to turn an export of that history into a profile of your reasoning that an AI agent can read. Here, an agent means any AI assistant that writes, plans or acts for you.

This page uses Base Layer, an open-source pipeline. It reads your history and writes a specification. The specification is a set of plain-text claims about how you reason, communicate and decide. An agent reads it before acting for you.

Step 1: export your history

  • ChatGPT: in Settings, open Data controls and choose Export data. You get a message with a link to a ZIP file when the export is ready, which can take a while. The link expires after 24 hours. Business and Enterprise workspaces cannot export this way. See OpenAI's help article.
  • Claude: on the web app or Claude Desktop, open Settings, then Privacy, and choose Export data. Anthropic emails you a download link that expires after 24 hours. Individual Free, Pro and Max accounts can do this. On Team and Enterprise plans, only the organization's Primary Owner can. See Anthropic's help article.

Base Layer also reads Claude Code sessions, a folder of journal entries, plain text files and meeting transcripts.

Step 2: install Base Layer

You need Python 3.10 or later, git, and an Anthropic API key in the ANTHROPIC_API_KEY environment variable.

pip install git+https://github.com/agulaya24/BaseLayer.git

The line above installs Base Layer version 0.5.0 from GitHub. Do not run pip install baselayer, because that name on PyPI belongs to another project.

Step 3: build the specification

Base Layer uses the cited build as its method. It uses only the messages you wrote yourself. It does not treat the assistant's replies or text you pasted in as your words. Every claim cites the facts it rests on, and every fact quotes your own words. The build takes eight commands, listed in the README. For about 50,000 words of your writing, the README projects $5 to $7.

baselayer run is the older, quicker path, with fewer checks. Its claims can cite facts but do not have to. It takes one command.

baselayer run chatgpt-export.zip

On the first run, it asks for your consent to process the data. It also asks for the writer's name and pronouns. It estimates the cost of pulling facts from your chats and asks before spending. Treat that estimate as a floor, since it has been too low before. For about 50,000 words of your writing, the README projects $1 to $2.

Both produce three layers called ANCHORS, CORE and PREDICTIONS. ANCHORS covers what you reason from. CORE covers how you communicate. PREDICTIONS covers how you are likely to respond in a given kind of situation.

Step 4: give it to your agent

The cited build writes its result as files you add to an agent's instructions yourself. You can add them to a system prompt, custom instructions, or a file like CLAUDE.md or AGENTS.md. Automatic serving is not built yet, and fact search is not available from those files.

You can serve a baselayer run build to Claude Code, Anthropic's coding agent. Register the Base Layer server once. The server is a small local program that gives Claude Code the specification through MCP (Model Context Protocol).

claude mcp add --scope user --transport stdio base-layer -- baselayer-mcp

New Claude Code sessions in any folder then receive the specification. Some clients shorten long server instructions, so the full text is also available as the memory://specification resource. Base Layer has been tested almost entirely with Anthropic's models.

Step 5: read it and correct it

A model wrote these claims, and it can misread you. Open the files and delete what is wrong. Rewrite what is close, and add what your chats never said. Only you can confirm that the specification describes you.

An example claim

Here is a claim from the cited example, built from Zitkala-Sa's American Indian Stories (1921, public domain). P15 is the claim's ID, and P marks the PREDICTIONS layer.

P15 TOLERANT TO PEOPLE HARSH TO SYSTEMS. Their severity is aimed at institutions and at settler power in the aggregate, not at individuals in front of them: in face-to-face disagreement, including religious disagreement, they extend respect, pity for suffering, and forgiveness over punishment. Predict the polemic in writing and the courtesy in the room.

Active when: They disagree with, or witness the hardship of, a particular person present

Evidence: [F-86fc472d] [F-cabf4c6c] [F-124a3cd5] ... (17 facts)

The Active when line tells the agent when the claim applies. The Evidence line lists the ids of the 17 facts used to write it. This published example used an earlier version of the cited build, before facts quoted their source text. Its evidence therefore shows fact ids only.

Privacy

Base Layer stores the database, facts and specification only on your machine. There are no accounts and no sync. The model steps send text to the Anthropic API, where Anthropic's retention policy applies. The step that pulls facts from your chats can run on a local model through Ollama instead. During import, Base Layer replaces secrets that have a recognisable pattern, such as API keys and card numbers, with a placeholder. It does not catch a secret written out in ordinary words.

Run it on your own writing, or on writing by someone who has agreed to it.

The code is on GitHub. The research behind it is in the paper on arXiv.