> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
