// 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.
// 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.
SYSTEM_INSTRUCTIONS.mdThe gate
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.mdBehavior
GAIA's full behavioral prompt: identity, tool philosophy, dependency & version rules, security, and the Claude Code engineering philosophy.
MEMORY_ENGINE.mdMemory + planning
Persistent memory (MEMORY.md) that survives auto-compaction, plus the plan engine (PLAN.md + TASKS.md) with per-task checkboxes.
TURN_ENGINE.mdTurns + 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.
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.
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.
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.
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.
Explore
GAIA reads MEMORY.md and the repo before touching anything, rebuilding context after every auto-compaction.
Plan
Non-trivial work becomes a written PLAN.md and TASKS.md you approve before a single line is generated.
Execute
It works task-by-task within a 15-call tool budget, flipping each TASKS.md checkbox the moment that task lands.
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.mdpastePasted into the Space Instructions field. Switches GAIA on, points it at the other three files, and hosts the slash-command skill engine.
SYSTEM_PROMPT.mduploadGAIA's full behavioral prompt: identity, tool philosophy, dependency & version rules, security, and the Claude Code engineering philosophy.
MEMORY_ENGINE.mduploadPersistent memory (MEMORY.md) that survives auto-compaction, plus the plan engine (PLAN.md + TASKS.md) with per-task checkboxes.
TURN_ENGINE.mduploadContext-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.