Skip to main content
Egnyte is a cloud-based content collaboration and file sharing platform that enables organizations to securely store, share, and govern their files. Egnyte combines the power of cloud content management with advanced security, compliance, and AI-powered search capabilities. This package provides a LangChain integration for Egnyte’s hybrid search API, which combines semantic and keyword search to help you find and retrieve documents from your Egnyte instance.

Installation and setup

pip install -U egnyte-langchain-connector

egnyte-langchain-connector

This package contains the LangChain integration with Egnyte. For more information about Egnyte, check out the Egnyte developer documentation.

Prerequisites

In order to integrate with Egnyte, you need:
  • An Egnyte account — If you are not a current Egnyte customer or want to test outside of your production Egnyte instance, you can use a free developer account.
  • An Egnyte app — This is configured in the developer console, and must have the appropriate scopes enabled.
  • The app must be enabled by the administrator.

Authentication

The egnyte-langchain-connector package uses Bearer token authentication with Egnyte user tokens.

Generating a user token

To generate an Egnyte user token for authentication:
  1. Register for a Developer Account
  2. Generate User Token
    • Use your API key to generate a user token following the Public API Authentication guide
    • Important: Use the scope Egnyte.ai when generating the token to ensure proper access to AI-powered search features

Using the token

You can pass the token directly to the retriever:
import getpass

egnyte_user_token = getpass.getpass("Enter your Egnyte User Token: ")
domain = "company.egnyte.com"  # Your Egnyte domain (without https://)
Or use environment variables:
import os
from dotenv import load_dotenv

load_dotenv()

egnyte_user_token = os.getenv("EGNYTE_USER_TOKEN")
domain = os.getenv("EGNYTE_DOMAIN")

Retrievers

EgnyteRetriever

See usage example
from langchain_egnyte import EgnyteRetriever

retriever = EgnyteRetriever(domain="company.egnyte.com")

Utilities

EgnyteSearchOptions

Configure advanced search parameters:
from langchain_egnyte import EgnyteSearchOptions

search_options = EgnyteSearchOptions(
    limit=50,
    folderPath="/policies",
    excludeFolderPaths=["/temp", "/archive"],
    createdAfter=1640995200000,  # Unix timestamp in milliseconds
    createdBefore=1672531200000
)

Help

If you have questions, you can check out the Egnyte developer documentation or reach out to us in our developer community.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.