reminix.adapters.langchain.from_langchain_agent

reminix.adapters.langchain.from_langchain_agent(langchain_agent, *, name, output_key=None, metadata=None)[source]

Create a Reminix Agent from a LangChain agent.

This adapter works with agents created using LangChain’s create_agent() API, which returns a CompiledGraph-like object.

Parameters:
  • langchain_agent (LangChainAgentProtocol) – A LangChain agent (result of create_agent()).

  • name (str) – Name for the Reminix agent.

  • output_key (str | None) – Optional key to extract from the final state as output.

  • metadata (dict[str, Any] | None) – Optional metadata for the agent.

Return type:

Agent

Returns:

A Reminix Agent that wraps the LangChain agent.

Example:

from langchain.agents import create_agent
from reminix.adapters.langchain import from_langchain_agent
from reminix.runtime import serve

agent = create_agent(
    model="openai:gpt-4o",
    tools=[search_tool, calculator_tool],
)

reminix_agent = from_langchain_agent(agent, name="smart-agent")
serve(reminix_agent)