// System architecture

ARCHITECTURE

One gate you paste into Perplexity, three engine files you upload. Here's exactly how GAIA Code wires itself together — and how a single turn runs.

1Gate
3Engine files
4Engines
15Tool calls / msg

// Deployment flow

ONE GATE. THREE ENGINES.

Paste the gate into your Space Instructions; upload the three engine files. GAIA reads all three on startup — skip one and that engine goes dark.

PASTE → SPACE INSTRUCTIONSSYSTEM_INSTRUCTIONS.md

The gate

Pasted into the Space Instructions field. Switches GAIA on, points it at the other three files, and hosts the slash-command skill engine.

UPLOAD → SPACE FILESYSTEM_PROMPT.md

Behavior

GAIA's full behavioral prompt: identity, tool philosophy, dependency & version rules, security, and the Claude Code engineering philosophy.

UPLOAD → SPACE FILEMEMORY_ENGINE.md

Memory + planning

Persistent memory (MEMORY.md) that survives auto-compaction, plus the plan engine (PLAN.md + TASKS.md) with per-task checkboxes.

UPLOAD → SPACE FILETURN_ENGINE.md

Turns + budget

Context-budget estimation so a turn never overflows, a 15-call tool budget, and size-aware commit batching.

// The four engines

NOT A PROMPT. A SYSTEM.

Each file drives one engine. Together they let GAIA remember, plan, pace itself, and run your skills.

Persistent Memory01

Survives auto-compaction.

GAIA keeps a MEMORY.md in its sandbox — project structure, your standing notes, and observations it records itself. It re-reads memory after every compaction and writes down mistakes it fixed so it never repeats them.

Plan Engine02

Explore. Plan. Approve. Execute.

Non-trivial work starts as a written PLAN.md you approve before a line is touched. Execution is tracked in TASKS.md with checkboxes flipped the moment each task lands — never batched at the end.

Turn Engine03

Never overflows the window.

Before generating, GAIA estimates the token cost of a turn and stops at a safe boundary, so Perplexity doesn't crash mid-task. Commits are batched by file size for clean, reliable history.

Skill Engine04

Slash-command skills.

Drop a skill file into the Space and call it with a slash command (e.g. /humanizer). GAIA adapts external, non-ported skills to the tools it actually has.

// How a turn runs

EXPLORE → PLAN → EXECUTE.

GAIA doesn't just answer — it works in a disciplined loop, the same one Claude Code uses.

01

Explore

GAIA reads MEMORY.md and the repo before touching anything, rebuilding context after every auto-compaction.

02

Plan

Non-trivial work becomes a written PLAN.md and TASKS.md you approve before a single line is generated.

03

Execute

It works task-by-task within a 15-call tool budget, flipping each TASKS.md checkbox the moment that task lands.

04

Commit

Changes are batched by file size and self-reviewed for the errors a build would catch before anything is pushed.

// File reference

THE FOUR FILES

SYSTEM_INSTRUCTIONS.mdpaste

Pasted into the Space Instructions field. Switches GAIA on, points it at the other three files, and hosts the slash-command skill engine.

SYSTEM_PROMPT.mdupload

GAIA's full behavioral prompt: identity, tool philosophy, dependency & version rules, security, and the Claude Code engineering philosophy.

MEMORY_ENGINE.mdupload

Persistent memory (MEMORY.md) that survives auto-compaction, plus the plan engine (PLAN.md + TASKS.md) with per-task checkboxes.

TURN_ENGINE.mdupload

Context-budget estimation so a turn never overflows, a 15-call tool budget, and size-aware commit batching.

// Questions

ARCHITECTURE FAQ

GAIA Code is a four-file prompt system that runs inside a Perplexity Space. It brings Claude Code's engineering workflow — persistent memory, a plan engine, context-budgeted turns, and a slash-command skill engine — into a Perplexity conversation.

// Deploy it

READY TO DEPLOY?

One gate, three engines. Have GAIA Code running in your Perplexity Space in minutes.