The Agent Toolkit: CrewAI, ADK, LangGraph, OpenAI on Glean
Wiring Glean retrieval into your framework of choice
You'll be able to
- Identify the agent frameworks Glean's platform supports as a retrieval backend
- Wire Glean search into a framework agent as a callable tool
Read first
Day 4 Lab
- Pick one framework your team uses: CrewAI, Google ADK, LangGraph, or the OpenAI Agents SDK.
- Install Glean's typed client and confirm a bare search call works (you did this in Week 7).
- Wrap that search call as a tool the framework can call, with a clear name and docstring.
- Register the tool with one agent and have it answer a question that requires company context.
Working Example: A Glean Search Tool for a Framework Agent
Glean describes building against its platform with frameworks such as CrewAI, Google ADK, LangGraph, and the OpenAI Agents SDK. The common core is small: wrap a typed-client search call as a tool, then let the framework orchestrate. Here the tool is framework-neutral β the same function plugs into any of them. Verified against developer_platform.
import os
from glean import Glean
# One client, authenticated once from the environment β never hard-code tokens.
_client = Glean(
instance=os.environ["GLEAN_INSTANCE"],
api_token=os.environ["GLEAN_API_TOKEN"],
)
def glean_search(query: str, top_k: int = 5) -> list[dict]:
"""Search the enterprise graph and return titles + URLs.
Wrap this as a tool in CrewAI / Google ADK / LangGraph / OpenAI Agents SDK.
Retrieval runs as the token's user, so results stay permissions-aware.
"""
resp = _client.client.search.query(query=query, page_size=top_k)
return [{"title": r.title, "url": r.url} for r in resp.results]
# CrewAI: Tool(name="glean_search", func=glean_search, description=...)
# OpenAI: @function_tool def glean_search(...) -> ...
# LangGraph: bind glean_search into a ToolNode
# Google ADK: register glean_search as a FunctionTool
The MAP lesson: whatever the framework, the trust boundary is the same β the tool carries a token that resolves to a user, so the agent can only ever retrieve what that user is allowed to see. Map that once and it holds across every framework. Verified against developer_platform.
Check for understanding
What is the one thing every framework's Glean tool has in common, regardless of framework?
Check yourself
1. Glean describes three agent run-modes. Which list matches them?
2. When a host connects to Glean's MCP server with a scoped token, what happens to access?
3. In a guarded multi-tool agent loop, what is the job of the pre-action gate?
4. Across CrewAI, Google ADK, LangGraph, and the OpenAI Agents SDK, what does every Glean tool have in common?
5. Which statement about this curriculum is accurate?
In 10 seconds
βCrewAI, Google ADK, LangGraph, OpenAI β Glean describes building with each against its platform. The pattern is identical: wrap a typed-client search call as a tool, and let the framework orchestrate.β
Tool Use & Orchestration: Multi-Step Agents with Guardrails