> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenGAP

> The Open Git Agent Protocol — a specification for portable, git-native AI agents.

OpenGAP (Open Git Agent Protocol) is an open specification that defines how AI agents should be structured in a git repository. It establishes the directory layout, manifest format, skill contract, and runtime protocol that any compliant agent runtime must support.

OpenGAP was formerly called GitAgent. It has been renamed to clarify its role: OpenGAP is the **specification**, while [GitAgent](../gitagent/overview) is the **reference implementation**.

## Why a protocol?

The AI agent ecosystem is fragmented. Every framework has its own way to define tools, store agents, and run them. An agent built with LangChain can't run on a CrewAI runtime. A LlamaIndex agent has a completely different structure from an AutoGen agent.

OpenGAP solves this by defining a **vendor-neutral, git-first structure** that any runtime can implement. An OpenGAP-compliant agent can be:

* Executed locally with `gitagent run`
* Deployed to Lyzr Studio by pointing at the repo
* Run in CI with any OpenGAP-compatible GitHub Action
* Loaded by any third-party tool that implements the spec

## The core idea

An OpenGAP agent is a directory. The directory's structure is the agent's definition.

```
my-agent/
├── agent.yaml      ← identity, model, config
├── skills/         ← what the agent can do
├── hooks/          ← lifecycle callbacks
├── flows/          ← multi-step workflows
├── memory/         ← memory configuration
└── tests/          ← skill and flow tests
```

Every component is a file. Files are versioned with git. Reviews are PRs. Deployments are tags.

## Specification areas

| Area                                         | What it defines                                            |
| -------------------------------------------- | ---------------------------------------------------------- |
| [Agent Manifest](./agent-manifest)           | `agent.yaml` schema — identity, model, config              |
| [Directory Structure](./directory-structure) | Required and optional directories, naming conventions      |
| [Framework Adapters](./framework-adapters)   | How to adapt LangChain, LlamaIndex, etc. agents to OpenGAP |
| [Design Patterns](./design-patterns)         | Recommended patterns for common agent architectures        |
| [Compliance](./compliance)                   | What a runtime must implement to be OpenGAP-compliant      |

## Versioning

OpenGAP follows semantic versioning. The current version is **0.4**.

The spec version is declared in `agent.yaml`:

```yaml theme={null}
opengap: "0.4"
name: my-agent
...
```

Runtimes that don't support the declared version must refuse to run the agent and report a clear error.

## Relationship to GitAgent

GitAgent is the reference implementation of OpenGAP. It tracks the spec version closely — each GitAgent minor version corresponds to an OpenGAP spec version.

The relationship:

* **OpenGAP** defines the "what" — the structure, contracts, and interfaces
* **GitAgent** defines the "how" — the Python runtime that implements them

Third parties can build their own runtimes (in Go, TypeScript, Rust) that execute OpenGAP agents without depending on GitAgent.

## Contributing to the spec

OpenGAP is developed in the open. Proposals go through an RFC process:

1. Open an issue in the [OpenGAP GitHub repo](https://github.com/LyzrCore/opengap) with the `rfc` label
2. Discuss and refine in the issue
3. Submit a PR to the spec document
4. Spec changes are merged after consensus among maintainers

See [Design Patterns](./design-patterns) for examples of community-contributed patterns that may become part of the spec.
