Integrations

LangChain

Installation

Install the integration package and configure your API key.

uv add langchain-quercle
View repository

Available tools

All five Quercle endpoints are exposed as tools through this integration.

ToolEndpointDescription
QuercleFetchToolFetchFetch a URL and return an AI-synthesized answer based on page content and your prompt.
QuercleSearchToolSearchSearch the web and return an AI-synthesized answer from the retrieved results.
QuercleRawFetchToolRaw FetchFetch a URL and return raw markdown or HTML.
QuercleRawSearchToolRaw SearchRun web search and return raw results.
QuercleExtractToolExtractFetch a URL and return chunks relevant to a query.

Endpoint examples

Use the same endpoint methods directly through this integration.

from quercle_langchain import QuercleFetchTool

tool = QuercleFetchTool(api_key="qk_your_api_key")
result = tool.invoke({"url": "https://example.com", "prompt": "Summarize the main points"})
print(result)

Use in agents

Wire the integration into your agent orchestration loop.

from quercle_langchain import QuercleFetchTool, QuercleSearchTool, QuercleRawFetchTool, QuercleRawSearchTool, QuercleExtractTool
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

model = ChatOpenAI(model="gpt-4o")
tools = [
    QuercleFetchTool(),
    QuercleSearchTool(),
    QuercleRawFetchTool(),
    QuercleRawSearchTool(),
    QuercleExtractTool(),
]
agent = create_react_agent(model, tools)

response = agent.invoke({
    "messages": [{"role": "user", "content": "Find and compare three trusted sources about prompt-injection defense"}]
})
print(response["messages"][-1].content)