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

# Overview

> Turn natural‑language prompts into executable, non‑custodial DeFi actions and portfolio insights. Works with any LLM via Compass LangChain Toolkit.

## What it is

Compass AI is your LLM’s gateway to DeFi. It translates **natural language** into **structured, ready-to-use DeFi actions**—whether that means executing a leveraged trade or checking a wallet’s P\&L.

Built on top of Compass Labs’ API, it supports both **execution and monitoring**, and works with **any LLM** supported by Langchain.

**Compass AI** is an LLM‑friendly layer on top of the Compass API. It converts plain English (e.g., “Borrow 1,000 USDC on Aave on Base”) into **structured, sign‑ready transactions** or **standardized data responses** (balances, positions, P\&L, rates).

* **Execution**: returns an **unsigned payload** you sign.
* **Monitoring**: returns data for balances, positions, APR/APY, prices, risk, and more.

**Non‑custodial by design**. We never hold keys or move assets.

<Check>
  **Compass AI is officially integrated with LangChain.** Use the [Compass Langchain Toolkit](https://python.langchain.com/docs/integrations/tools/compass/) to add DeFi to your chat interface.
</Check>

## When to use it

* Add **AI agents** that can execute swaps, lends/borrows, LP, leverage, or rebalance.
* Let users **ask in natural language** to check balances, position health, and yield.
* Prototype **agentic flows** quickly without writing protocol adapters.

## How it works

Each Compass API action (swap, lend, borrow, repay, withdraw, bundle, balances, positions, etc.) is exposed as a **LangChain Tool** with an input/output schema.

1. **User asks in plain English.** The LLM parses the user's intent, and picks the right tool. .
2. **Deterministic execution.** The tool calls Compass, which returns either a **sign‑ready transaction** or **data**.
3. **You keep the keys.** Payloads are **unsigned**. You review, sign, and broadcast. Compass never holds keys.

**Why this approach?** Reliability. We push as much logic as possible into **deterministic tools**, and keep the LLM focused on **intent parsing**. The result: predictable behavior and a safer UX.

## Ways to Integrate

**Compass AI is officially integrated with LangChain.** Use the [Compass Langchain Toolkit](https://python.langchain.com/docs/integrations/tools/compass/) to add DeFi to your chat interface.

<Steps>
  <Step title="Install the langchain package">
    ```
    pip install -qU langchain-compass
    ```

    #### **Environment Setup**[**​**](https://python.langchain.com/docs/integrations/tools/compass/#environment-setup)

    To run these examples, ensure LangChain has access to an LLM service. For instance, if you're using GPT-4o, create a `.env` file containing:

    ```
    # .env file
    OPENAI_API_KEY=<your_openai_api_key_here>Import and instantiate the toolkit
    ```
  </Step>

  <Step title="Import and instantiate the toolkit">
    ```
    from langchain_compass.toolkits import LangchainCompassToolkit

    toolkit = LangchainCompassToolkit(compass_api_key=None)
    ```
  </Step>

  <Step title="Pass the tools to your agent with toolkit.get_tools()">
    View [available tools](https://python.langchain.com/docs/integrations/tools/compass/#tool-features):

    ```
    tools = toolkit.get_tools()
    for tool in tools:
        print(tool.name)
    ```

    ```
    # Expected output:

    aave_supply
    aave_borrow
    aave_repay
    aave_withdraw
    aave_asset_price_get
    aave_liquidity_change_get
    aave_user_position_summary_get
    ...
    ```
  </Step>
</Steps>
