Handit.AI
  • Introduction
    • Introduction
    • Quick Start
  • Agent Creation
    • Overview
    • Interactive Agent Setup
    • Define Your Agent with a JSON Configuration
  • Code Integration
    • Overview
    • MCP Server Setup
    • Context Based Setup
    • Manual Setup
  • Best Practices
    • Input/Output Tracking
    • Service Initialization
    • Error Handling
Powered by GitBook
On this page
  • Overview
  • Quick Start: Load Your Context into Cursor
  • Connecting Your Code to Handit
  • What’s Inside the Context Files?
  • Next Steps
  1. Code Integration

Context Based Setup

PreviousMCP Server SetupNextManual Setup

Last updated 1 month ago

This guide walks you through setting up Handit.AI using context files, ideal for teams who work with version control, automated deployments, or need maximum flexibility across environments.

Overview

The Context-Based Setup uses configuration files to define your agent’s behavior, monitoring rules, and integration points. This approach works across any AI framework or language, making it incredibly versatile.

Why use context files?

  • Framework-agnostic – works with any AI system or stack

  • Define multiple contexts – for different environments, workflows, or models

  • Map complex workflows – easily link models, tools, and routes

  • No core code changes – configure behavior externally

  • Ideal for evolving AI pipelines – supports experimentation and iteration

Quick Start: Load Your Context into Cursor

This step adds your agent's context files into Cursor so the AI assistant can understand how your agent works and suggest accurate code instrumentation.

  1. Download the context zip file from your Handit.AI dashboard

  2. Extract the zip file to your project directory

  3. Open AI Chat

  4. Click "Add Context Files"

  5. Select the extracted context files to add them to Cursor's AI context

Once added, your AI is now aware of your agent’s structure and can assist in connecting it to your code.

Connecting Your Code to Handit

With your context loaded, you can now use AI to automatically integrate Handit into your project.

To automatically connect Handit to your codebase, use the AI by typing:

configure Handit on my agent on these files ... based on the context

The AI will analyze your codebase and automatically:

  • Configure the necessary Handit.AI client

  • Set up the appropriate tracking points

  • Connect your code to the context

  • Generate the required configuration files

This process removes the need for manual setup and ensures your code is ready for monitoring and optimization.

What’s Inside the Context Files?

The context .zip includes three key components:

  • rules – Define behavioral constraints and agent logic

  • configuration – Set environment variables and agent-wide settings

  • llms – Configure models, prompts, and language model preferences

These files work together to describe how your agent should function, behave, and monitor itself.

Next Steps

- Learn about best practices for using Handit.AI

Best Practices Guide