LangChain / LangGraph
Claix tools for LangChain and LangGraph
Endpoint
SDK
pip install 'claix-ai[langchain]'Three LangChain BaseTools wrap the same ClaixClient: extract a file, ask a persisted document, or ask a knowledge space. Use them with LangGraph create_react_agent or any LangChain agent that accepts tools.
1. Links
- GitHub · claix-python — claix/integrations/langchain.py
- PyPI · claix-ai[langchain] — installs langchain-core with the SDK
- LangChain Python docs — tools and agent runtimes
- LangGraph docs — ReAct graphs and prebuilt agents
- Python SDK — ClaixClient, auth, and method map
2. Tools
| Class | Tool name | What it does |
|---|---|---|
| ClaixExtractTool | claix_extract | Extract schema-typed JSON from PDF, Excel/CSV, Word/text, or image. Optional space_id and is_agent_mode. |
| ClaixDocumentContextTool | claix_document_context | Ask 1–5 questions about a persisted document_id (max 400 chars each). |
| ClaixSpaceContextTool | claix_space_context | Cross-document Q&A over a knowledge space_id — compare, sum, reconcile. |
3. LangGraph ReAct
from claix import ClaixClient
from claix.integrations.langchain import (
ClaixDocumentContextTool,
ClaixExtractTool,
ClaixSpaceContextTool,
)
from langgraph.prebuilt import create_react_agent
client = ClaixClient()
tools = [
ClaixExtractTool(client=client),
ClaixDocumentContextTool(client=client),
ClaixSpaceContextTool(client=client),
]
agent = create_react_agent("openai:gpt-4.1", tools)
agent.invoke({
"messages": [{
"role": "user",
"content": "Extract invoice.pdf with schema 3c7a9f21-4b8e-4d1a-9c6f-2e0d8a5b7c4f, then ask the document_id for the VAT total.",
}]
})create_react_agent builds a StateGraph that loops until the model stops calling tools. Prefer ClaixSpaceContextTool for multi-file nodes.