← Back to docs
LangChain
LangChain is a framework for developing applications powered by language models. With Astapa, your LangChain agents can safely query and mutate production data without the risk of unreviewed changes.
Features
- Drop-in toolkit for LangChain agents
- Automatic query sandboxing
- Human-in-the-loop approval workflow
- Full audit trail of agent actions
- Works with any LangChain-compatible LLM
Quick Start
example.py
from langchain.agents import initialize_agent
from astapa import AstapaToolkit
# Initialize Astapa toolkit
toolkit = AstapaToolkit(
api_url="http://localhost:8080",
database="mydb",
user="agent",
password="secret"
)
# Create agent with Astapa tools
agent = initialize_agent(
tools=toolkit.get_tools(),
llm=llm,
agent="zero-shot-react-description"
)
# Agent can now safely query and mutate data
agent.run("Update the user's subscription to premium")