Skip to main content

langchain-mesharc

The LangChain integration for MeshArc, the web crawler that turns sites into clean markdown and records what changed between crawls.

  • MeshArcLoader loads web pages as LangChain Documents, in four modes: scrape, crawl, map and changes.
  • MeshArcSearch and MeshArcScrape are tools an agent can call to search the web and read pages.

The full guide, with every option, the metadata on each Document and how to keep a vector store current, is at mesharc.dev/docs/langchain.

pip install langchain-mesharc

You need a MeshArc API key. Make one under Settings → API keys at mesharc.dev; the free plan includes 1,000 credits with no card. Set it as MESHARC_API_KEY, or pass api_key=. Reading pages and searching need a key with write access.

Document loader

from langchain_mesharc import MeshArcLoader

# One page, or many read as one batch
docs = MeshArcLoader("https://example.com/pricing").load()
docs = MeshArcLoader(["https://example.com/", "https://example.com/about"]).load()

# A whole site, or a section of it; pages arrive as they are read
loader = MeshArcLoader("https://docs.example.com", mode="crawl",
                       params={"limit": 100, "includePaths": ["/guides/*"]})
for doc in loader.lazy_load():
    print(doc.metadata["url"], len(doc.page_content))

# The URLs a site declares in its sitemaps, without fetching them
urls = MeshArcLoader("https://docs.example.com", mode="map").load()

# What changed on a watched site since the last crawl
changed = MeshArcLoader(mode="changes", project_id="<project id>").load()
Mode Input Each Document
scrape a URL or a list of URLs the page's markdown
crawl a site's URL; params takes limit, maxDepth, includePaths, excludePaths and the rest of the crawl options one per page read
map a site's URL; params takes search and limit one per URL in the sitemaps, with the URL as its text
changes project_id, and optionally run_id and against one per added or modified page, holding the page as it is now

Metadata on every page: source and url, title, page_status (one word: ok, missing, blocked, captcha, …), crawled_at and mode.

  • Scraped and changed pages also have status, the HTTP status. A crawl's pages don't, because the API leaves it out of crawl results.
  • Scraped pages also have verdict and credits.
  • A crawl adds crawl_id.
  • Changes add project_id, run_id, previous_run_id, changed_at, change (added, modified, removed or fields), words_before and words_after.

Values are always strings, numbers or booleans, so any vector store accepts them.

Pages that came back with no content (blocked, or a 404) are left out. Pass include_empty=True to keep them; their page_status and error_code say why. In changes mode, removed pages are left out unless include_removed=True.

changes mode keeps a vector store current: load it after each run of a MeshArc project, and re-embed only the pages that changed. Each Document's id is run_id:url.

Tools

from langchain_mesharc import MeshArcScrape, MeshArcSearch

tools = [MeshArcSearch(), MeshArcScrape()]
Tool The agent gives It gets back
mesharc_search (MeshArcSearch) query, limit (1–10), read_pages a numbered list of results (title, URL, snippet), and with read_pages each result's page text
mesharc_scrape (MeshArcScrape) urls (1–20) each page's title, URL and markdown, or why a page could not be read

Both tools return content_and_artifact:

  • the content is the text sent to the model, with each page cut at max_chars_per_page (8,000 by default; 0 for no limit);
  • the artifact is MeshArc's full response.

A refused request, such as one with too few credits left, comes back to the agent as an error message rather than stopping it.

Cost

Requests are billed in MeshArc credits, the same as any other API call:

  • a plain page read costs 1 credit, and blocked pages and 404s cost nothing;
  • a web search costs what reading its results page costs;
  • a sitemap read costs 1 credit per sitemap file.

See pricing.

License

MIT

Metadata

Release files for langchain-mesharc 0.1.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-mesharc 0.1.1
File Size Uploaded Provenance Actions
langchain_mesharc-0.1.1.tar.gz 12.5 kB With provenance Details for langchain_mesharc-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-mesharc 0.1.1
File Interpreter ABI Platform Actions
langchain_mesharc-0.1.1-py3-none-any.whl Python 3 none any Details for langchain_mesharc-0.1.1-py3-none-any.whl

Total release size: 24.7 kB

Release files / langchain_mesharc-0.1.1.tar.gz

Download URL langchain_mesharc-0.1.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ed49f5a7ec37ec8eff1229da750707ae8138df505eb3cdb5fe427e3e7127074f
BLAKE2b-256 checksum
How to use checksums
227df2939b6ecfe6f7ffea85bb99b8c8a21e5c81ba412a07f4ffe7f5e2e08cef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 24, 2026.

Transparency log

Release files / langchain_mesharc-0.1.1-py3-none-any.whl

Download URL langchain_mesharc-0.1.1-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ad1ed6b99158956ca4775d46f4cf4cae6554965c5b085b8c395e003d9750ece
BLAKE2b-256 checksum
How to use checksums
8ad0db97dda7bc43bf9341386442b598d131717c169ecebbaee994f3706bf921
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 24, 2026.

Transparency log

Security for langchain-mesharc 0.1.1

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_mesharc-0.1.1.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 24, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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