LangChain + AccountsOS
UK accounting tools for LangChain agents
Add AccountsOS tools to your LangChain agents and chains. Query transactions, manage VAT, track deadlines, and categorise expenses — all as native LangChain tools with full type safety.
13
Tools
2
SDKs
UK
Accounting
Typed
Schemas
from langchain.agents import create_tool_calling_agent
from langchain_openai import ChatOpenAI
from accountsos_langchain import AccountsOSToolkit
# Set up tools
toolkit = AccountsOSToolkit(api_key="sk_live_...")
tools = toolkit.get_tools()
# Create agent
llm = ChatOpenAI(model="gpt-4")
agent = create_tool_calling_agent(llm, tools, prompt)
# Run
agent.invoke({
"input": "What's my VAT position for Q4?"
})Available Tools
| Tool | Scope |
|---|---|
get_transactions | read |
get_balance | read |
get_vat_summary | read |
get_deadlines | read |
create_transaction | write |
update_transaction | write |
categorize_transaction | write |
list_categories | read |
create_deadline | write |
search_documents | read |
upload_document | write |
get_dla_balance | read |
get_invoices | read |
Features
Native LangChain tool wrappers for all 13 AccountsOS endpoints
Python and JavaScript SDK support
Full type safety with Pydantic models and Zod schemas
Works with LangChain agents, chains, and LangGraph
Streaming support for real-time responses
Built-in retry logic and error handling
How It Works
Install the AccountsOS tools package
Install the LangChain-compatible tool package via pip or npm.
pip install accountsos-langchain
# or
npm install @accountsos/langchainInitialise tools with your API key
Create the toolset with your API key. All 13 tools are registered automatically.
from accountsos_langchain import AccountsOSToolkit
toolkit = AccountsOSToolkit(
api_key="sk_live_..."
)
tools = toolkit.get_tools()Add to your agent
Pass the tools to any LangChain agent. The agent can now query and manage your books.
from langchain.agents import create_tool_calling_agent
agent = create_tool_calling_agent(
llm=llm,
tools=tools,
prompt=prompt
)Benefits
Native LangChain tool interface — no custom wrappers needed
Full type safety with Pydantic and Zod schemas
Works with any LLM that LangChain supports
Combine with other LangChain tools and chains
Built-in error handling and retry logic
Frequently Asked Questions
Does this work with LangGraph?
Yes. The AccountsOS tools work with LangChain agents, chains, and LangGraph. Use them in stateful graph workflows for complex accounting automation.
Which LLMs are supported?
Any LLM that LangChain supports — OpenAI, Anthropic Claude, Google Gemini, Mistral, Llama, and more. The tool schemas are provider-agnostic.
Is there a JavaScript version?
Yes. Install @accountsos/langchain via npm for LangChain.js. The API is identical to the Python version with TypeScript type definitions.
Can I use only specific tools?
Yes. The toolkit lets you select specific tools: toolkit.get_tools(include=['get_balance', 'get_transactions']). This limits what your agent can access.
Ready to connect LangChain?
AI-powered accounting for your UK limited company.
Get Started FreeFree during Early Access - No credit card - Cancel anytime