Skip to main content

An integration package connecting Keenable web search and LangChain

Project description

langchain-keenable

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

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://keenable.ai/console

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
    # "mode": "realtime",          # optional per-call override (needs an org key)
})
for result in results:
    print(result["title"], result["url"])

mode defaults to "pro" (deeper retrieval); use "realtime" for latency-sensitive cases such as voice agents. It can be set as a class default and overridden per call. realtime requires an org key.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_keenable-0.1.1.tar.gz (146.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_keenable-0.1.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file langchain_keenable-0.1.1.tar.gz.

File metadata

  • Download URL: langchain_keenable-0.1.1.tar.gz
  • Upload date:
  • Size: 146.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for langchain_keenable-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e336d14ecc09984434d3179ae644c483f01db41d6f8fb6b61f334422446a865
MD5 7186ee33931a1ebe77f47373ec1594cc
BLAKE2b-256 1172f1858f604d1830d250592917a402f04faa7039a63ef610ce13e0f0252cb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_keenable-0.1.1.tar.gz:

Publisher: publish.yml on keenableai/langchain-keenable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_keenable-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_keenable-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 590de23d4a2b758e6c0eb57eb03d28d25f8395c4b80bc1fbf37af1a1addcd619
MD5 969eee045ff04d21ea56f308be1a13f1
BLAKE2b-256 7e150de3fde824922f21890f664863e4366ec656316f31cbcde70dd748374ad5

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_keenable-0.1.1-py3-none-any.whl:

Publisher: publish.yml on keenableai/langchain-keenable

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page