Skip to content

🧠 Structured AI workflow architecture for Google Antigravity IDE. Persistent 3-layer memory bank, automated project documentation generator, self-evaluating 23-point scoring system, and modular rule engine with 12 doc templates. Drop .agents/ into any project for instant AI-powered docs, architecture diagrams, and cross-session memory.

License

Notifications You must be signed in to change notification settings

samex/google-antigravity-cortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Google Antigravity Cortex β€” Memory Bank & Documentation Generator

License

Structured AI workflow architecture for Google Antigravity β€” project understanding, documentation generation, and persistent memory across coding sessions.

An .agents rule and workflow system that turns your AI IDE into a disciplined software documentation writer and project analyst. Drop .agents/ into any project and your AI assistant gains structured memory, self-evaluation, and professional documentation pipelines.

Built for Google Antigravity IDE β€” easily adaptable to any AI IDE using the cascade method (e.g. Windsurf) with minor rule adjustments.


πŸ“Œ What This Is

This is not just a memory bank. It is:

  • πŸ” A project-overview generator β€” deep-analyzes your workspace and produces structured project documentation from source code
  • πŸ“ A documentation writer β€” generates professional docs (requirements, tech stack, features, user flows, architecture diagrams) using templates and modular rules
  • 🧠 A persistent memory system β€” maintains three-layer memory (working, short-term, long-term) across sessions so the AI never loses context
  • βš–οΈ A self-evaluating workflow engine β€” scores its own output on a 23-point system with a Creator β†’ Critic β†’ Defender β†’ Judge cycle

⚑ Quick Start

New or Existing Project

  1. Copy the .agents/ directory to your project root
  2. Set up global rules:
    • Open Google Antigravity's agent customization settings (or your AI IDE's equivalent)
    • Paste the contents of GEMINI.md into the global rules editor
    • Alternatively, place it at ~/.gemini/GEMINI.md (the default global rules path)
  3. Start a chat and type:
Initialize your Memory Bank with the "SessionStart" workflow.

The AI will scaffold .agents/memory-bank/ with core files, plans, task logs, and error records. On existing projects it detects the structure and fills gaps without overwriting.


πŸ—οΈ How It Works

flowchart TD
    subgraph "Global Layer"
        GR["🌐 GEMINI.md
        (Global Rules)"]
    end

    subgraph ".agents/ β€” Project Layer"
        subgraph "Rules (always_on)"
            WR["βš™οΈ workspace-rule.md
            Core operating rules"]
            DR["πŸ“„ documentation-rule.md
            Doc base principles"]
        end

        subgraph "Rules (model_decision)"
            WS["ws-* rules
Workflow diagrams, events,
functions, error recovery,
evaluation"]
            DS["doc-* rules
Per-document guidance
(10 specialized rules)"]
        end

        subgraph "Templates"
            T["πŸ“‹ documentation-templates/
Fill-in templates for
each document type"]
        end

        subgraph "Workflows"
            WF1["▢️ /project-overview
Project stocktaking"]
            WF2["▢️ /project-documentation
Full doc suite generation"]
        end
    end

    subgraph "Output"
        MB["🧠 .agents/memory-bank/
Persistent memory"]
        DOCS["πŸ“ docs/
Generated documentation"]
    end

    GR --> WR
    WR --> WS
    DR --> DS
    DS --> T
    WF1 --> MB
    WF2 --> DS
    WF2 --> T
    WF2 --> DOCS
    WS --> MB
Loading

Two trigger tiers keep the AI's context lean:

Trigger Loaded Purpose
always_on Every session Core operating constraints, base documentation principles
model_decision On demand Topic-specific guidance (e.g., writing dependency docs)

πŸ“ Directory Structure

your-project/
└── .agents/
    β”œβ”€β”€ rules/                         # AI behavior rules
    β”‚   β”œβ”€β”€ workspace-rule.md          # βš™οΈ (always_on) Core operating rules
    β”‚   β”œβ”€β”€ ws-workflow-diagrams.md    # (model_decision) Mermaid workflow visuals
    β”‚   β”œβ”€β”€ ws-event-handlers.md       # (model_decision) Session/task lifecycle
    β”‚   β”œβ”€β”€ ws-function-map.md         # (model_decision) XML function map
    β”‚   β”œβ”€β”€ ws-error-recovery.md       # (model_decision) Retry logic, escalation
    β”‚   β”œβ”€β”€ ws-evaluation.md           # (model_decision) Scoring + self-critique
    β”‚   β”œβ”€β”€ documentation-rule.md      # πŸ“„ (always_on) Documentation principles
    β”‚   β”œβ”€β”€ doc-project-overview.md    # (model_decision) Project overview
    β”‚   β”œβ”€β”€ doc-dependencies.md        # (model_decision) Dependency docs
    β”‚   β”œβ”€β”€ doc-features.md            # (model_decision) Feature specification
    β”‚   β”œβ”€β”€ doc-requirements.md        # (model_decision) Requirements
    β”‚   β”œβ”€β”€ doc-tech-stack.md          # (model_decision) Tech stack
    β”‚   β”œβ”€β”€ doc-user-flow.md           # (model_decision) User flows
    β”‚   β”œβ”€β”€ doc-implementation-standards.md  # (model_decision) Coding standards
    β”‚   β”œβ”€β”€ doc-project-structure.md   # (model_decision) Directory docs
    β”‚   β”œβ”€β”€ doc-meta-workflow.md       # (model_decision) Meta-workflow
    β”‚   └── doc-architecture-visual.md # (model_decision) Architecture diagrams
    β”œβ”€β”€ documentation-templates/       # πŸ“‹ Fill-in templates for each doc type
    └── workflows/                     # ▢️ Executable workflow definitions
        β”œβ”€β”€ project-overview.md        # /project-overview
        └── project-documentation.md   # /project-documentation

▢️ Workflows

/project-overview β€” Project Stocktaking

Analyzes your entire workspace (manifests, configs, source, infrastructure) and generates a structured project-overview.md.

Run the /project-overview workflow.
  • Create Mode β†’ Deep source analysis, populate every section from code evidence
  • Update Mode β†’ Memory bank delta analysis, surgical updates to stale sections only

/project-documentation β€” Full Documentation Suite

Generates a complete documentation set in docs/ using all 10 doc-* rules and their templates:

Run the /project-documentation workflow.
Step Output What It Does
0 β€” Analyze workspace, determine project type
1 project-overview.md Vision, problem, solution, scope, risks
2 dependencies.md Auto-extracted deps with versions and docs links
3 features.md Hierarchical feature specification
4 requirements.md Functional + technical requirements
5 tech-stack.md Technology justification with alternatives
6 user-flow.md User-perspective flow documentation
7 implementation-standards.md Code patterns with real examples
8 project-structure.md Directory reasoning and conventions
9 meta-workflow-integration.md Memory system integration
10 architecture.md Mermaid architecture diagrams
11 β€” Cross-reference validation

🧠 Memory Bank

Three-layer memory system in .agents/memory-bank/:

.agents/memory-bank/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ activeContext.md      # πŸ”„ Working Memory β€” current focus
β”‚   β”œβ”€β”€ projectbrief.md       # Project goals and constraints
β”‚   β”œβ”€β”€ productContext.md     # User needs and requirements
β”‚   β”œβ”€β”€ systemPatterns.md     # Architecture decisions
β”‚   β”œβ”€β”€ techContext.md        # Stack, dependencies, tooling
β”‚   └── progress.md           # Roadmap and status
β”œβ”€β”€ plans/                    # πŸ“‹ Implementation plans
β”œβ”€β”€ task-logs/                # πŸ“Š Per-task records with scoring
β”œβ”€β”€ errors/                   # πŸ”§ Error patterns and resolutions
└── memory-index.md           # πŸ—‚οΈ Master index with checksums

Working Memory updates every task. Short-Term Memory (task logs) captures recent decisions. Long-Term Memory (core files) persists architecture knowledge.


βš–οΈ Self-Evaluation

Every task is scored on a 23-point scale:

Score Rating
21–23 βœ… Excellent (β‰₯90%)
18–20 β˜‘οΈ Sufficient (β‰₯78%)
< 18 ❌ Fail β€” requires remediation

The self-critique cycle: Creator (generate) β†’ Critic (identify weaknesses) β†’ Defender (fix issues) β†’ Judge (score and compare).


πŸ’‘ Usage Tips

Situation Prompt
πŸš€ Start of session Initialize your Memory Bank with the "SessionStart" workflow.
πŸ” AI loses focus Remember to follow the Memory System.
πŸ“ Force task logging Make sure you are keeping a task log and update memory.
βš–οΈ Quality review Execute Evaluation Phase.
πŸ“ Generate project docs Run the /project-documentation workflow.
πŸ” Project stocktake Run the /project-overview workflow.

πŸ™ Credits & Attribution

This project is a fork and evolution of the Engineered Meta-Cognitive Workflow Architecture by Shawn McAllister (@entrepeneur4lyf) / Engineered Automated Systems for Artificial Intelligence (EASAI).

The original work established the core concepts: XML function maps, Mermaid workflow diagrams, three-layer memory, event-driven handlers, and the self-critique cycle. This fork adapts and extends it with modular rule splitting, documentation generation workflows, and template-driven doc pipelines.

Credit to Nick Baumann w/ Cline Memory Bank for the original memory bank concept.


πŸ“„ License

Apache License 2.0 β€” see LICENSE for details.

About

🧠 Structured AI workflow architecture for Google Antigravity IDE. Persistent 3-layer memory bank, automated project documentation generator, self-evaluating 23-point scoring system, and modular rule engine with 12 doc templates. Drop .agents/ into any project for instant AI-powered docs, architecture diagrams, and cross-session memory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published