Why Use Tensorlake + LangChain?
The Problem:- Agents need to process documents mid-conversation but parsing happens outside the workflow
- Manual file preprocessing breaks agentic automation
- Agents can’t extract structured data, tables, or figures without custom code
- No way to handle document parsing as a tool in agent toolchains
- Automatic parsing - Agents parse documents when needed, no preprocessing
- Tool integration - Document parsing becomes a native agent capability
- Structured extraction - Pull metadata, tables, and figures in agent workflows
- Production-ready - Handle financial reports, research papers, and contracts in conversational AI
Installation
Quick Start
Step 1: Set API Keys
Step 2: Create Agent with Document Parsing Tool
Build a LangGraph agent that can parse documents automatically:- Detected the PDF URL in the query
- Called Tensorlake to parse the financial statement
- Extracted revenue data from tables
- Answered the question with specific figures
How Agent-Based Parsing Works
Traditional document pipelines require upfront processing. Agents can’t adapt to new files during conversations. This integration changes the workflow:- During conversation: User mentions a file URL
- Tool invocation: Agent recognizes it needs document content and calls the Tensorlake tool
- Parsing: Tensorlake parses the document and extracts text, tables, and data
- Context injection: Parsed content returns to the agent’s context window
- Response generation: Agent answers using the parsed document
Use Cases
Financial Analysis Agents
Build analysts that parse earnings reports, balance sheets, and regulatory filings on-demand. Extract revenue, expenses, and key metrics without manual preprocessing.Research Assistants
Create agents that read research papers mid-conversation. Automatically extract abstracts, methodologies, and experimental results when users ask questions.Legal Document Review
Build agents that analyze contracts and legal briefs. Parse clause content, extract key terms, and compare documents during conversations.Customer Support Automation
Enable support agents to parse product manuals, warranty documents, and technical specs when helping customers.Compliance Monitoring
Create agents that review regulatory filings and compliance documents. Extract required disclosures and flag missing information.Best Practices
1. Design Clear Agent Prompts
Help agents understand when to use document parsing:2. Handle Multiple Documents Efficiently
Process documents in parallel when comparing multiple files:3. Validate Tool Usage
Monitor agent behavior to ensure proper tool usage:Using the Python SDK Directly
For non-agentic workflows, use the Tensorlake Python SDK directly in LangChain pipelines:Complete Example
Try the full working example with financial analysis agent:Agentic Document Parsing Notebook
Complete code walkthrough.
What’s Next?
Build advanced agents:- LangGraph Documentation - Learn agent architectures
- Tensorlake API Reference - Explore parsing options
- Qdrant Integration - Build RAG agents
- ChromaDB Integration - Add citation tracking