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

# Connecting your data

> Give agents access to external sources using context providers.

Product agents that work with live business state need current records and product actions. Context providers connect them to sources such as web search, files, databases, Slack, Google Drive, and MCP servers.

In default mode, context providers expose a source through `query_<source>` and, where enabled, `update_<source>`. The query surface can delegate source-specific work to a sub-agent. Set `mode=ContextMode.tools` when the calling agent should receive the provider's underlying tools directly.

```python theme={null}
from agno.agent import Agent
from agno.context.web import ExaBackend, WebContextProvider
from agno.models.openai import OpenAIResponses

web = WebContextProvider(backend=ExaBackend(), model=OpenAIResponses(id="gpt-5.5"))

agent = Agent(
    model=OpenAIResponses(id="gpt-5.5"),
    tools=web.get_tools(),
    instructions=web.instructions() + "\nAlways cite URLs inline.",
)

agent.run("What's the latest pricing for Anthropic's models?")
```

## Query sources at run time

Context providers call the configured source when the agent invokes their tools. Freshness depends on the source API, backend, and any caching it applies. Providers can return source URIs or synthesized text; links and citations depend on the provider and its output.

Vector retrieval remains useful for indexed corpora. Context providers are useful when a task needs source-specific navigation or current records from an external system.

| Behavior            | What determines it                                         |
| ------------------- | ---------------------------------------------------------- |
| Source freshness    | The source API, provider backend, and caching              |
| Links and citations | The provider's returned documents and the agent's response |
| Accessible records  | The permissions granted to the provider's credentials      |

## Provider modes

Each provider ships a recommended tool surface. Override `mode` to trade tool count against direct control.

| Need                                                  | Mode                                             |
| ----------------------------------------------------- | ------------------------------------------------ |
| Provider-recommended tool surface                     | `ContextMode.default`                            |
| One natural-language query tool backed by a sub-agent | `ContextMode.agent`                              |
| Direct control over provider operations               | `ContextMode.tools` exposes the underlying tools |

```python theme={null}
from agno.context import ContextMode
from agno.context.web import ExaBackend, WebContextProvider

web = WebContextProvider(backend=ExaBackend(), mode=ContextMode.tools)
```

## Sources

| Source          | Tools                               | Backed by                                                    |
| --------------- | ----------------------------------- | ------------------------------------------------------------ |
| Web             | `query_web`                         | Exa, Parallel, or an MCP search backend                      |
| Filesystem      | `query_fs`                          | A local directory of files, read-only                        |
| Workspace       | `query_workspace`                   | A filesystem path or repo, read-only                         |
| Database        | `query_database`, `update_database` | SQLAlchemy read and write engines                            |
| Knowledge wiki  | `query_wiki`, `update_wiki`         | Filesystem, a Git repo, or Notion for durable prose memory   |
| Slack           | `query_slack`, `update_slack`       | Slack API, reads and writes                                  |
| Google Drive    | `query_gdrive`                      | A service account or OAuth credentials, read-only            |
| Gmail           | `query_gmail`, `update_gmail`       | Gmail API with Google credentials; writes are off by default |
| Google Calendar | `query_calendar`, `update_calendar` | Google Calendar API; writes are off by default               |
| MCP servers     | `query_mcp_<slug>`                  | Any MCP server: Linear, GitHub, Notion                       |

## Read-only providers

For providers that support writes, `write=False` removes the update tool from the default surface. A read-only provider such as the web has no update tool. This setting does not change permissions for other clients or integrations that can access the same source.

## Next steps

| Task                          | Guide                                                                |
| ----------------------------- | -------------------------------------------------------------------- |
| Reach users where they work   | [Interfaces](/use-cases/product-agents/interfaces)                   |
| Persist what the agent learns | [Sessions and memory](/use-cases/product-agents/sessions-and-memory) |

## Developer Resources

* [Context engineering](/context/overview)
* [Context providers cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/12_context)
* [What are Context Providers?](/context-providers/overview)
* [Scout: connect MCP servers](/deploy/templates/scout/overview)
