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

# Installation

> Set up Agent Contracts in minutes

In this section, we will show how to quickly instrument your agent code to collect traces and install agent contracts to run offline verification or runtime certification.

<Steps>
  <Step title="Install agent contracts">
    Install agent contracts.

    ```bash theme={null}
    git clone https://github.com/relari-ai/agent-contracts.git
    cd agent-contracts
    poetry install
    ```
  </Step>

  <Step title="Install relari-otel in your Agent">
    In your agent repository, install the `relari-otel` package to collect traces.

    ```bash theme={null}
    pip install relari-otel[langchain,openai,certification]
    ```
  </Step>

  <Step title="Option A: Set up Agent Contracts for Offline Verification">
    In the `agent-contracts` directory, start the agent contract service for verification. You can come back to this step after you've created your first verification specification (more details in [Scenarios and Specifications](/contracts/specifications)).

    ```bash theme={null}
    make docker-verification
    ```

    Initialize telemetry code in your agent code

    ```python app.py theme={null}
    from relari_otel.otel import Relari

    Relari.init(project_name="Your Project Name", batch=False)
    ```
  </Step>

  <Step title="Option B: Set up Agent Contracts for Runtime Certification">
    In the `agent-contracts` directory, start the agent contract service for runtime certification. You can come back to this step after you've created your first certification specification (more details in [Scenarios and Specifications](/contracts/specifications)).

    ```bash theme={null}
    export RUNTIME_VERIFICATION_CONFIG="configs/runtime-certification.yaml" && \
    export RUNTIME_VERIFICATION_SPECS="specs.json" && \
    make docker-runtime-certification
    ```

    Initialize telemetry code in your agent code

    ```python app.py theme={null}
    from relari_otel.otel import Relari

    Relari.init(project_name="Your Project Name", batch=False, certification_enabled=True)
    ```
  </Step>
</Steps>

## Next Steps

Now that you've installed agent contracts:

1. Learn more about creating [contracts](/contracts/contracts) and [specifications](/contracts/specifications)
2. Learn more about using agent contracts for [offline verification](/verification/verification) and [runtime certification](/certification/certification)
