
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
alation-ai-agent-langchain
Advanced tools
This package integrates the Alation AI Agent SDK with the Langchain framework, allowing Langchain agents to leverage metadata from the Alation Data Catalog.
The Langchain integration enables:
pip install alation-ai-agent-langchain
import os
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_openai_functions_agent
from langchain.prompts import ChatPromptTemplate, MessagesPlaceholder
from alation_ai_agent_sdk import AlationAIAgentSDK, ServiceAccountAuthParams
from alation_ai_agent_langchain import get_langchain_tools
# Initialize Alation SDK using service account authentication (recommended)
sdk = AlationAIAgentSDK(
base_url=os.getenv("ALATION_BASE_URL"),
auth_method="service_account",
auth_params=ServiceAccountAuthParams(
client_id=os.getenv("ALATION_CLIENT_ID"),
client_secret=os.getenv("ALATION_CLIENT_SECRET")
)
)
# Get Langchain tools
tools = get_langchain_tools(sdk)
# Define agent prompt
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful assistant using Alation's metadata catalog."),
("user", "{input}"),
MessagesPlaceholder(variable_name="agent_scratchpad"),
])
# Initialize LLM and create agent
llm = ChatOpenAI(model="gpt-4o", temperature=0)
agent = create_openai_functions_agent(llm=llm, tools=tools, prompt=prompt)
# Create agent executor
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
# Run the agent
response = executor.invoke({
"input": "What tables contain customer data?"}
)
print(response)
You can pass Alation signatures through the Langchain agent:
# Define a signature to customize the response
tables_only_signature = {
"table": {
"fields_required": ["name", "title", "description", "url"]
}
}
# Pass the signature with the input
response = executor.invoke({
"input": "What tables contain sales data?",
"signature": tables_only_signature,
})
print(response)
See the examples directory for a complete example of a return eligibility agent built with Langchain and Alation.
FAQs
Alation Agent SDK for Langchain
We found that alation-ai-agent-langchain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.