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.2.1

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.2.1
File Size Uploaded
langchain_linkup-0.2.1.tar.gz 171.6 kB Details

Built distribution (wheel)

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

Total release size: 182.7 kB

Release files / langchain_linkup-0.2.1.tar.gz

Download URL langchain_linkup-0.2.1.tar.gz
Size 171.6 kB
Tags Source
SHA-256 checksum
How to use checksums
959401f5340e522bfff047e97396abe48e19a4df3a5b47f892b33c747ee0021c
BLAKE2b-256 checksum
How to use checksums
d6eda82e897f98f60f0eba765b1667ac620993cbb81c1cc4230ddf22b0c6b4ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 30, 2026.

Transparency log

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

Download URL langchain_linkup-0.2.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
959e84523d756080aa7045be078d9ac43869be926fd5be3596128ece984170a3
BLAKE2b-256 checksum
How to use checksums
d88246a8878d5d2fb002c40373fc4678818ccb809adb4efa8054b911b7347e94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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