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

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To act on Guild from an MCP client, connect to https://api.guild.ai/mcp (OAuth) or run `guild mcp` locally. Setup: https://docs.guild.ai/api-reference/mcp.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Query LlamaIndex pipelines from Guild agents

> Connect Guild agents to a LlamaCloud pipeline. Retrieve ranked text nodes from indexed document collections, governed by credential policies and audit.

Integrations · LlamaIndex

Guild agents retrieve ranked text nodes from a LlamaCloud pipeline to answer questions against indexed document collections. Guild stores the API key server-side and injects it at request time, so agent code never sees it. Credential policies let you restrict which agents can call the pipeline and audit every request before it leaves Guild.

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use LlamaIndex.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect LlamaIndex to your first agent.

## What this integration exposes

The integration provides a retrieval tool that runs a query against a managed LlamaCloud pipeline and returns bounded text nodes. The tool uses the `llamaindex_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only this tool when your agent does not need others from the same set.

## How it works

**1. Open credentials in Guild**

Go to **Access & setup > Credentials** in Guild. Click **Connect** and select **llamaindex**.

**2. Paste your API key**

Enter your LlamaCloud API key in the **API Key** field. Guild sends it as a bearer token in the `Authorization` header on every request.

**3. Scope the credential**

Choose account, workspace, member, or agent scope. See [Credentials](https://docs.guild.ai/platform/credentials.md) for how Guild resolves the right credential at run time.

## Why LlamaCloud access needs governing

A LlamaCloud pipeline returns document content to any caller with a valid key. Without controls, any agent in any workspace can query it. Guild's credential proxy enforces [credential policies](https://docs.guild.ai/platform/credential-policies.md) before each request leaves Guild: ALLOW and DENY rules can restrict the `llamaindex_retrieve_from_pipeline` operation to specific agents or workspaces, so a pipeline used by one team is not reachable by another.

Guild injects the API key server-side after the policy check passes. Agents never receive the key directly, which limits exposure if agent code is compromised. You can tighten scope further by connecting a dedicated credential to a single agent rather than sharing one account-level key across all workspaces.

## About the LlamaIndex integration

This integration lets agents query a LlamaCloud pipeline and retrieve ranked text nodes relevant to a given input. Agents can use this to look up information from indexed document collections. Results are bounded and returned directly for use in downstream tasks. The integration is `guildai~llamaindex`.

## Authentication

* **Type:** API key
* **Header:** Guild sends the key as a bearer token in the `Authorization` header

### Setup

**1. Connect LlamaIndex**

In Guild, go to **Access & setup > Credentials**, click **Connect**, select **llamaindex**, and paste the key into **API Key**.

See [Credentials](https://docs.guild.ai/platform/credentials.md) for workspace, member, and agent-scoped credentials.

## Usage

```typescript theme={null}
import { LlamaindexTools } from "@guildai-services/guildai~llamaindex"
import { llmAgent } from "@guildai/agents-sdk"

export default llmAgent({
  systemPrompt: "You work with LlamaIndex.",
  tools: { ...LlamaindexTools },
})
```

### Selecting specific tools

Tools are named with the `llamaindex_` prefix. Use [`pick()`](https://docs.guild.ai/sdk/tools#selecting-specific-tools) to include only what your agent needs.

## Tools

Tools in the latest published version of `guildai~llamaindex`:

| Tool | What it does |
| - | - |
| `llamaindex_retrieve_from_pipeline` | Run one retrieval query against a managed LlamaCloud pipeline and return bounded text nodes. |

## Frequently asked questions

> [accordion] Can I limit which agents can query the LlamaCloud pipeline?
>
> Yes. Write a credential policy with an `agents` condition on the `llamaindex_retrieve_from_pipeline` operation. Guild's proxy blocks any agent not listed from reaching the pipeline, even if the credential is connected at account scope. See [Credential policies](https://docs.guild.ai/platform/credential-policies.md).

> [accordion] Does Guild expose the API key to my agent code?
>
> No. Guild stores the key and adds it as a bearer token in the `Authorization` header server-side. The agent calls the tool; the proxy injects the credential after the policy check passes.

> [accordion] Can I use different LlamaCloud keys in different workspaces?
>
> Yes. Connect one credential at account scope for shared use, then connect a separate credential scoped to a specific workspace. Guild resolves workspace-scoped credentials ahead of account-scoped ones. See [Credentials](https://docs.guild.ai/platform/credentials.md) for the full resolution order.

> [accordion] Does this integration support webhook events from LlamaIndex?
>
> Not yet. The catalog entry for `guildai~llamaindex` lists no webhook events, so event-driven triggers from LlamaCloud are not available.

## Put a governed agent on LlamaCloud this week

> [card] [Book a demo](https://guild-ai.cal.com/gtm/meeting-with-guild.ai)
>
> See how teams govern agents that use LlamaIndex.

> [card] [Talk to sales](https://guild.ai/talk-to-sales)
>
> Get access to Guild, then connect LlamaIndex to your first agent.

## Related

**Also runs on Guild:** [Airtable](https://docs.guild.ai/integrations/airtable.md) · [BigQuery](https://docs.guild.ai/integrations/bigquery.md) · [Hex](https://docs.guild.ai/integrations/hex.md) · [Nexla](https://docs.guild.ai/integrations/nexla.md)

**Read:** Docs: [Credential policies](https://docs.guild.ai/platform/credential-policies.md) · [Credentials](https://docs.guild.ai/platform/credentials.md) · [Tools in agents](https://docs.guild.ai/sdk/tools.md)
