LangChain Integration
Build agents with Glean and LangChain
Glean LangChain Integration
Glean’s official LangChain integration enables you to build powerful AI agents that can search and reason over your organization’s knowledge using Python and the LangChain framework.
langchain-glean
Official LangChain integration for Glean’s search and chat capabilities
Installation
Configuration
API Tokens
You’ll need Glean API credentials, and specifically a user-scoped API token. API Tokens require the following scopes: chat
, search
. You should speak to your Glean administrator to provision these tokens.
Configure Environment Variables
Configure your Glean credentials by setting the following environment variables:
Usage Examples
Using the Retriever
The GleanSearchRetriever
allows you to search and retrieve documents from Glean:
Building an Agent with Tools
The GleanSearchTool
can be used in LangChain agents to search Glean:
RAG with LangChain Chains
You can integrate the retriever with LangChain chains for more complex workflows:
Advanced Usage
Search Parameters
You can customize your search by passing additional parameters:
Custom Retriever Configuration
Configure the retriever with custom settings:
For the complete API documentation and implementation details, visit the GitHub repository.