Skip to main content

langchain-keenable

This package contains the LangChain integration with Keenable, a web search and page-fetch API built for AI agents.

Guide with an agent example and MCP setup: docs.keenable.ai/integrations/langchain.

Installation

pip install -U langchain-keenable

Optionally set a KEENABLE_API_KEY environment variable to use the authenticated endpoints. Without a key, both search and fetch transparently fall back to their keyless public endpoints.

export KEENABLE_API_KEY="your-api-key"  # optional; create one at https://app.keenable.ai/console/api-keys

The API endpoint defaults to https://api.keenable.ai and can be overridden (e.g. for staging) with the KEENABLE_API_URL environment variable. It must be an https:// URL.

Tools

KeenableSearch

Queries the Keenable search API and returns a list of result dictionaries. All filters are per-invocation, so an agent can vary them per query:

from langchain_keenable import KeenableSearch

# Works with no key (keyless public endpoint) or with KEENABLE_API_KEY set.
tool = KeenableSearch()

results = tool.invoke({
    "query": "typescript best practices",
    "site": "github.com",          # optional: restrict to a domain
    "published_after": "2026-01-01",  # optional: YYYY-MM-DD date filters
    # "published_before" / "acquired_after" / "acquired_before" also supported
})
for result in results:
    print(result["title"], result["url"])

objective (optional, at most 1,000 characters) says what the search is for: what the query leaves out and what earlier searches found. Pass it for multi-step or ambiguous questions, not every search. Keenable ranks results by query and objective together; retrieval reads only query, so put the words that matter in query. Blank values are not sent.

tool.invoke({
    "query": "Q3 2026 revenue",
    "objective": "I need Acme Corp's reported Q3 2026 revenue in USD from its own investor relations page, not press speculation.",
})

mode defaults to "pro" (deeper retrieval). It can be set as a class default and overridden per call.

KeenableFetch

Fetches a page via Keenable and returns its main content as markdown — pair it with KeenableSearch so an agent can read the pages it discovers:

from langchain_keenable import KeenableFetch

tool = KeenableFetch()
page = tool.invoke({"url": "https://example.com/article"})
print(page["title"], page["content"])

Error handling

Both tools set handle_tool_error = True: rate limits (429), auth (401) and credit (402) errors, network timeouts and malformed responses are surfaced to the agent as an error string (carrying the backend's message) rather than raising and crashing the agent loop.

Async

Both tools implement _arun, so await tool.ainvoke({...}) works (the request runs in a worker thread).

The tools can be bound to any LangChain chat model that supports tool calling and used within an agent.

Metadata

Release files for langchain-keenable 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-keenable 0.2.0
File Size Uploaded Provenance Actions
langchain_keenable-0.2.0.tar.gz 149.2 kB With provenance Details for langchain_keenable-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-keenable 0.2.0
File Interpreter ABI Platform Actions
langchain_keenable-0.2.0-py3-none-any.whl Python 3 none any Details for langchain_keenable-0.2.0-py3-none-any.whl

Total release size: 159.7 kB

Release files / langchain_keenable-0.2.0.tar.gz

Download URL langchain_keenable-0.2.0.tar.gz
Size 149.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1957b4da76fc1eb4e07511f0a4e250fda0b8bfe9878157b9789aee4e990c407e
BLAKE2b-256 checksum
How to use checksums
c51ad8b94860f8483e95b57fbd4857fefd2a8fa4bf44b95b599cd95484ce39e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / langchain_keenable-0.2.0-py3-none-any.whl

Download URL langchain_keenable-0.2.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ad8d537091ca912f134d06c7d50269fe2397970e5b192a51cfc08c244960dad
BLAKE2b-256 checksum
How to use checksums
7cec112e6e253fd3141941a2a9b4374f2c3a8c910d9929b6703c4a1b8f332875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for langchain-keenable 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_keenable-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page