How I Built a Persistent Memory System for Antigravity (with /start Workflow, Session Management & LazyGravity)

Hi everybody,

The Problem

Every Antigravity user knows the pain: you close a conversation (or it crashes), and your agent forgets everything. You start over, re-explain context, waste time. After losing context too many times, I decided to build a system that solves this permanently.

The Solution: A /start Workflow

I created a structured memory system that my agent (named “Jarvis”) reads at the beginning of every conversation using a simple /start command.

Architecture Overview

WORKSPACE/

├── .agents/workflows/

│ └── start.md ← The /start workflow

├── JARVIS/ ← Agent brain

│ ├── GEMINI.md ← Identity + global rules (also at ~/.gemini/GEMINI.md)

│ ├── operating_rules.md ← Anti-crash rules, work rules, session rules

│ ├── JARVIS_MEMORY.md ← Current context (projects, services, state)

│ ├── CONFIG_TECHNIQUE.md ← Full technical state (VPS, Docker, etc.)

│ ├── NOTES_TECHNIQUES.md ← Known pitfalls, lessons learned

│ ├── USER.md ← User profile & preferences

│ ├── ARBORESCENCE.md ← Workspace file map

│ │

│ └── sessions/ ← Daily session logs

│ ├── 2026-03-02.md

│ ├── 2026-03-03.md

│ └── 2026-03-04.md ← Today’s session

The /start Workflow

The workflow file (

.agents/workflows/start.md) handles 3 scenarios automatically:

Case A — New Day (no session file for today)

  1. Reads all base files (rules, memory, config, notes, user profile, file map)

  2. Reads the last closed session (:locked:)

  3. Creates today’s session file with a timestamped RECAP

  4. Lists tasks from Dart (project management tool)

  5. Asks: “Good morning! Here are your tasks. What do we tackle?”

Case B — Mid-Session Resume (session file exists with :pause_button: marker)

  1. Reads base files + today’s session

  2. Adds a resume entry to the RECAP

  3. Summarizes where we left off

Case C — Crash Recovery (session file exists without any marker)

  1. Reads base files + today’s session

  2. Checks recently modified files to reconstruct context

  3. Adds a recovery entry with :warning:

  4. Asks: “I’m back from an interruption. Here’s what I found — is this right?”

Session Markers

Marker Meaning When to use
:pause_button: Context pause (mid-session) When you need to refresh context
:locked: Session closed End of day
(none) Crash / interruption Detected automatically

Key Design Decisions

1. Keep memory files small

  • JARVIS_MEMORY.md = < 3 KB — only current state, not history

  • History goes into session files (one per day)

  • Detailed docs in separate files, only read when needed

2. Anti-crash rules

  • Context limit = 200K tokens — do /start regularly during intensive sessions

  • Limit SSH output — always | head -N or | tail -N

  • Max ~2h per conversation — then RECAP + new conversation

  • Launch with --agent-max-context=185000 for safety margin

3. Timestamped RECAP

Every action is logged in the session file with timestamps:

markdown

## RECAP

- 08h37 : New day started

- 09h17 : Created Dart task for scheduled jobs

- 10h03 : Critical issue found — Tristan memory not writing since 02/28

- 12h04 : OpenCortex installed and verified :white_check_mark:

This makes crash recovery trivial — the agent just reads the RECAP and knows exactly where you left off.

4. GEMINI.md = Always-loaded identity

The file at ~/.gemini/GEMINI.md is read by Antigravity at every conversation start, even without /start. I use it for:

  • Agent identity (“You are Jarvis”)

  • The instruction to run /start workflow

Bonus: Remote Access with LazyGravity

I also installed LazyGravity to control Antigravity from my phone:

  • Telegram bot — send messages, get responses from Antigravity

  • Discord bot — same, with slash commands and project management

  • Connected via CDP (Chrome DevTools Protocol)

This means I can ask my agent to check Docker status, read Dart tasks, or look up a file — all from my smartphone while I’m away from my desk. It’s a “light mode” (no /start context), but with full tool access.

Bonus 2: Dart → Discord Integration

I connected Dart (AI project management) to Discord via webhooks:

  • Every task created/updated in Dart → notification in Discord

  • My AI agents (Jarvis via Antigravity + Tristan via OpenClaw) both have Dart access

  • Dart serves as a communication bridge between AI agents

Results After 2+ Weeks

  • :white_check_mark: Zero context loss — every session picks up exactly where the last one left off

  • :white_check_mark: Crash recovery works — agent reconstructs context from session files

  • :white_check_mark: Productive sessions — no more wasting 15 min re-explaining context

  • :white_check_mark: Mobile access — quick commands from phone via Telegram/Discord

  • :white_check_mark: Multi-agent coordination — Jarvis (Antigravity) and Tristan (OpenClaw) share tasks through Dart

Tips for Getting Started

  1. Start simple — create GEMINI.md with your agent’s identity + one memory file

  2. Add a /start workflow — even a basic “read these 2 files” version helps enormously

  3. Log your sessions — timestamped RECAPs are the #1 thing that prevents context loss

  4. Keep files small — the agent reads faster and retains more

  5. Use markers (:pause_button: / :locked:) — so the agent knows if it’s resuming or starting fresh

I’d love to hear what systems you’ve built for your agents! Any suggestions to improve this setup? :lobster:

2 Likes

Hi @Romain_Antigravity
Welcome to the Google AI Forum!!!

Thank you for your valuable feedback. We sincerely appreciate you taking the time to share your thoughts with the community. Your input is crucial for our continuous improvement and we have shared it directly with the relevant internal team.

1 Like

What a great inspiration - thanks :heart_eyes:


Fun fact: I found your post as a quote in my gemini research