Back to GigaRAG

Connect an agent

Give an AI tool access to your GigaRAG Workspace, so it can search, read and write your memos while it works.

LangChain

Load GigaRAG tools into LangChain and LangGraph agents.

Use it in code

The snippet has your key in it so it runs as pasted. Move it to an environment variable before the code is committed or shared.

  1. 1.

    Install the MCP adapters

    pip install langchain-mcp-adapters
  2. 2.

    Load the GigaRAG tools

    import asyncio
    from langchain_mcp_adapters.client import MultiServerMCPClient
    
    
    async def main():
        client = MultiServerMCPClient({
            "gigarag": {
                "transport": "streamable_http",
                "url": "https://mcp.gigarag.com/mcp",
                "headers": {"Authorization": "Bearer <api-key>"},
            }
        })
        tools = await client.get_tools()
        print([tool.name for tool in tools])
    
    
    asyncio.run(main())

Check it worked

Send this once it is connected. An answer drawn from your workspace means the connection is live.

Run it. It should print the names of the GigaRAG tools.

Written from the official docs: langchain-mcp-adapters