Skip to main content

ToolTrace LangChain Integration

LangChain document loader and tools for the ToolTrace web intelligence API. Load webpages as LangChain Documents for RAG pipelines, or give your agents web scraping, SEO audit, and tech stack detection capabilities.

Install

pip install tooltrace-langchain

Document Loader

Load webpages as LangChain Documents with clean Markdown content and rich metadata:

from tooltrace_langchain import ToolTraceLoader

loader = ToolTraceLoader(
    urls=[
        "https://example.com/blog/post-1",
        "https://example.com/blog/post-2",
    ],
    api_key="your-key",
)

docs = loader.load()
for doc in docs:
    print(doc.metadata["title"])
    print(doc.page_content[:200])

Document metadata

Each document includes:

  • source: Final URL after redirects
  • title: Page title
  • canonical_url: Canonical URL
  • author: Author name
  • language: Content language
  • published_at: Publication date
  • word_count: Word count
  • render_method: Whether static or browser rendering was used
  • content_hash: Content hash for change detection

Agent Tools

Give LangChain agents web intelligence capabilities:

from tooltrace_langchain import (
    ToolTraceExtractTool,
    ToolTraceMetadataTool,
    ToolTraceSeoAuditTool,
    ToolTraceTechStackTool,
)

tools = [
    ToolTraceExtractTool(api_key="your-key"),
    ToolTraceMetadataTool(api_key="your-key"),
    ToolTraceSeoAuditTool(api_key="your-key"),
    ToolTraceTechStackTool(api_key="your-key"),
]

# Use with any LangChain agent
from langchain.agents import AgentExecutor, create_tool_calling_agent

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)
result = executor.invoke({"input": "What technologies does example.com use?"})

RAG pipeline example

from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain.text_splitter import RecursiveCharacterTextSplitter

from tooltrace_langchain import ToolTraceLoader

# Load pages
loader = ToolTraceLoader(
    urls=["https://tooltrace.io/docs"],
    api_key="your-key",
)
docs = loader.load()

# Split and index
splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
chunks = splitter.split_documents(docs)
vectorstore = FAISS.from_documents(chunks, OpenAIEmbeddings())

# Query
results = vectorstore.similarity_search("How does rendering work?")

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tooltrace_langchain-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tooltrace_langchain-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file tooltrace_langchain-0.1.0.tar.gz.

File metadata

  • Download URL: tooltrace_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for tooltrace_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 24a44e5af7be3d67392c469e6a5995047ff1ec799a1509633d19ce70d4a86dd6
MD5 539520a08e793d24e40189673da28b07
BLAKE2b-256 7a048a2621b66171a9c969976b101d78f9cdfffdc53fb651130a5fb8f35cea86

See more details on using hashes here.

File details

Details for the file tooltrace_langchain-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tooltrace_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59e212b0e39b15a9084d085b764bc6ca0e3500316d5466b10befe47a3adf07e4
MD5 fdd48ad3177effd275c42e604e3e817f
BLAKE2b-256 dbc0df6f42b35b294cccc4fe43d805ff1174f549e0bf99fd8b5281c8839687df

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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