Skip to main content

⚡ Langchain Linkup

PyPI version License: MIT

A LangChain integration for the Linkup API, allowing easy integration with Linkup's services. 🔗

🌟 Features

  • 🔗 Simple LangChain components to cover all Linkup API use cases.
  • 🔍 Supports both standard and deep search queries.
  • ⚡ Supports synchronous and asynchronous requests.
  • 🔒 Handles authentication and request management.

📦 Installation

Simply install the LangChain integration using pip:

pip install langchain-linkup

🛠️ Usage

Setting Up Your Environment

  1. 🔑 Obtain an API Key:

    Sign up on Linkup to get your API key.

  2. ⚙️ Set-up the API Key:

    Option 1: Export the LINKUP_API_KEY environment variable in your shell before using the Linkup LangChain component.

    export LINKUP_API_KEY='YOUR_LINKUP_API_KEY'
    

    Option 2: Set the LINKUP_API_KEY environment variable directly within Python, using for instance os.environ or python-dotenv with a .env file (python-dotenv needs to be installed separately in this case), before creating the Linkup LangChain component.

    import os
    from langchain_linkup import LinkupSearchRetriever
    
    os.environ["LINKUP_API_KEY"] = "YOUR_LINKUP_API_KEY"
    # or dotenv.load_dotenv()
    retriever = LinkupSearchRetriever(...)
    ...
    

    Option 3: Pass the Linkup API key to the Linkup LangChain component when creating it.

    from langchain_linkup import LinkupSearchRetriever
    
    retriever = LinkupSearchRetriever(api_key="YOUR_LINKUP_API_KEY", ...)
    ...
    

📋 Example

All search queries can be used with two very different modes:

  • with depth="standard", the search will be straightforward and fast, suited for relatively simple queries (e.g. "What's the weather in Paris today?")
  • with depth="deep", the search will use an agentic workflow, which makes it in general slower, but it will be able to solve more complex queries (e.g. "What is the company profile of LangChain accross the last few years, and how does it compare to its concurrents?")

🔍 Linkup Search Retriever

A retriever is a LangChain component which simply retrieves documents based on a query. It is typically the first step of a RAG (Retrival Augmented Generation) pipeline. See this page for more information. The LinkupSearchRetriever makes available the Linkup API search as a LangChain retriever.

from langchain_linkup import LinkupSearchRetriever

# Initialize the LangChain component (API key can be read from the environment variable or passed as
# an argument)
retriever = LinkupSearchRetriever(
    depth="deep",  # "standard" or "deep"
)

# Perform a search query
documents = retriever.invoke(input="What is Linkup, the new French AI startup?")
print(documents)

⚒️ Linkup Search Tool

A tool is a LangChain component which enables agents to perform a specific task, like a web search. Tools are designed to be called autonomously by the agent, and their output is fed back to the agent, allowing them to perform some kind of reasoning based on the tool usage. See this page for more information. The LinkupSearchTool makes available the Linkup API search as a LangChain tool.

from langchain_linkup import LinkupSearchTool

# Initialize the LangChain component (API key can be read from the environment variable or passed as
# an argument)
tool = LinkupSearchTool(
    depth="deep",  # "standard" or "deep"
    output_type="searchResults",  # "searchResults", "sourcedAnswer" or "structured"
)

# Perform a search query
search_results = tool.invoke(input="What is Linkup, the new French AI startup?")
print(search_results)

📚 More Examples

See the examples/ directory for more contextualized examples and documentation, for instance on how to use the Linkup Search Retriever in a simple RAG pipeline.

Metadata

Release files for langchain-linkup 0.3.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-linkup 0.3.0
File Size Uploaded Provenance Actions
langchain_linkup-0.3.0.tar.gz 178.7 kB With provenance Details for langchain_linkup-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-linkup 0.3.0
File Interpreter ABI Platform Actions
langchain_linkup-0.3.0-py3-none-any.whl Python 3 none any Details for langchain_linkup-0.3.0-py3-none-any.whl

Total release size: 189.9 kB

Release files / langchain_linkup-0.3.0.tar.gz

Download URL langchain_linkup-0.3.0.tar.gz
Size 178.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3f170d5088059be0e9cddd02d23172b0185cd8b9dced837dead227ce0c50cfd2
BLAKE2b-256 checksum
How to use checksums
592d624ca052231ad4337d9f2d46feafed50bc98714e788cefc740e8af24d6f1
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 Oct 22, 2026.

Transparency log

Release files / langchain_linkup-0.3.0-py3-none-any.whl

Download URL langchain_linkup-0.3.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64db659f4672bf9920c5fbc1546127c4ee0c8e2821a3c0cf3df34ee7f5ed8007
BLAKE2b-256 checksum
How to use checksums
fadf70909b677a9e974e885f07e51c723ee5b318cb531789e98d34dd6b891942
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 Oct 22, 2026.

Transparency log

Security for langchain-linkup 0.3.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_linkup-0.3.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 Oct 22, 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