> For the complete documentation index, see [llms.txt](https://docs.goproxies.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.goproxies.com/proxies/integrations/ai-integrations/langchain.md).

# LangChain

LangChain is a popular framework for building LLM-powered applications and agents. This guide shows how to route your LangChain requests through GoProxies, which is particularly useful for web scraping tools, search integrations, and agent workflows.

#### Requirements

Before getting started, ensure that:

* No other VPN or proxies are active.
* You have your GoProxies endpoint ready, e.g. `proxy.goproxies.com:1080`
* Your GoProxies subuser (also called API User) username and password.
* Python is installed on your machine.

#### Proxy Setup

LangChain picks up proxy settings from environment variables. Set these before running your application:

```
HTTP_PROXY=http://customer-your_username_here:your_password@proxy.goproxies.com:1080
HTTPS_PROXY=http://customer-your_username_here:your_password@proxy.goproxies.com:1080
```

Or set them directly in your Python script before importing LangChain:

python

```python
import os
os.environ["HTTP_PROXY"] = "http://customer-your_username_here:your_password@proxy.goproxies.com:1080"
os.environ["HTTPS_PROXY"] = "http://customer-your_username_here:your_password@proxy.goproxies.com:1080"
```

{% hint style="info" %}
To target a specific country, append `-country-country_abbreviation` after your username, e.g. `customer-exampleuser-country-us`, as covered in our [proxy parameters article](https://docs.goproxies.com/proxies/rotating-residential-proxies/proxy-parameters).
{% endhint %}

#### Verify the Connection

Add a quick request to `https://ip.goproxies.com` in your script using LangChain's `RequestsGetTool` or a simple `requests` call — if the returned IP reflects your proxy location, you're all set.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.goproxies.com/proxies/integrations/ai-integrations/langchain.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
