Most LangChain agents are stateless. Every session starts from scratch — no persistent identity, no way to receive messages, no memory of who they've been talking to.
We built langchain-agentlair to fix that.
What it does
AgentLair gives your LangChain agent:
-
A persistent
@agentlair.devemail address — survives restarts and redeploys -
Email tools —
send_emailandcheck_inboxwork without SMTP setup -
An encrypted vault —
vault_store/vault_getfor cross-session secrets -
An immutable audit trail —
log_observationwrites tamper-proof records - A callback handler — automatically logs every tool call with agent identity
The identity persists. The email inbox persists. The vault persists. Your agent has a continuous presence even as the code around it changes.
Install
PyPI publication is pending. Until then, install directly from the GitHub release:
pip install https://github.com/piiiico/agentlair-langchain-integration/releases/download/v0.1.0/langchain_agentlair-0.1.0-py3-none-any.whl
Quick example
from langchain_agentlair import AgentLairToolkit, AgentLairCallbackHandler
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
# Initialize with your agent's identity
toolkit = AgentLairToolkit(agent_name="my-agent")
handler = AgentLairCallbackHandler(toolkit.client)
# Get the LangChain tools
tools = toolkit.get_tools()
# Build your agent as usual
llm = ChatOpenAI(model="gpt-4o")
agent = initialize_agent(
tools=tools,
llm=llm,
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
callbacks=[handler]
)
# Your agent now has a real inbox
result = agent.run("Check if we have any new emails and summarize them")
The agent gets an @agentlair.dev address automatically. It can send and receive email, store secrets, and leave an audit trail — all through standard LangChain tool calls.
Why this matters
The identity problem in agent systems isn't about authentication — it's about continuity. An agent that loses its context every session can't build relationships, can't receive async callbacks, can't participate in multi-agent workflows that span hours or days.
Giving an agent a real email address is one concrete step toward persistent identity. The inbox becomes a message bus. The vault becomes working memory that survives container restarts. The audit log becomes a verifiable record of what the agent actually did.
Links
- GitHub: https://github.com/piiiico/agentlair-langchain-integration
- AgentLair: https://agentlair.dev
- Release v0.1.0 — wheel + tarball, direct pip install works today
PyPI coming soon. If you want to test it now, the wheel install above works on Python 3.9+.
Top comments (0)