langchain-hs-0.0.2.0: Haskell implementation of Langchain
Copyright(c) 2025 Tushar Adhatrao
LicenseMIT
MaintainerTushar Adhatrao <[email protected]>
Safe HaskellNone
LanguageHaskell2010

Langchain.Agents.Core

Description

Agents use LLMs as reasoning engines to determine actions dynamically.

Synopsis

Documentation

data AgentAction Source #

Represents an action to be taken by the agent

Constructors

AgentAction 

Fields

Instances

Instances details
Show AgentAction Source # 
Instance details

Defined in Langchain.Agents.Core

Eq AgentAction Source # 
Instance details

Defined in Langchain.Agents.Core

data AgentFinish Source #

Represents that agent has finished work with final value

Constructors

AgentFinish 

Instances

Instances details
Show AgentFinish Source # 
Instance details

Defined in Langchain.Agents.Core

Eq AgentFinish Source # 
Instance details

Defined in Langchain.Agents.Core

data AgentStep Source #

Type that will be return from LLM Could be either Continue, making another call to LLM or Finish with final value

Instances

Instances details
Show AgentStep Source # 
Instance details

Defined in Langchain.Agents.Core

Eq AgentStep Source # 
Instance details

Defined in Langchain.Agents.Core

class Agent a where Source #

Typeclass for Agent

Instances

Instances details
LLM llm => Agent (ReactAgent llm) Source # 
Instance details

Defined in Langchain.Agents.React

data AnyTool Source #

A type that helps various types of Tools It encapsulates the Tool, and conversion functions to and from Text for Tool input and output since Agent takes and returns Text. If Tool takes or returns Text type itself you can use id at these places.

Constructors

Tool a => AnyTool 

Fields

data BaseMemory m => AgentState m Source #

Type for maintaining state of the agent

Constructors

AgentState 

Fields

Instances

Instances details
(BaseMemory m, Show m) => Show (AgentState m) Source # 
Instance details

Defined in Langchain.Agents.Core

(BaseMemory m, Eq m) => Eq (AgentState m) Source # 
Instance details

Defined in Langchain.Agents.Core

Methods

(==) :: AgentState m -> AgentState m -> Bool #

(/=) :: AgentState m -> AgentState m -> Bool #

runAgent :: (Agent a, BaseMemory m) => a -> AgentState m -> Text -> IO (Either String AgentFinish) Source #

Function that *starts* the agent process.

runAgentLoop :: (Agent a, BaseMemory m) => a -> AgentState m -> Int -> Int -> IO (Either String AgentFinish) Source #

Helper function for runAgent

executeTool :: [AnyTool] -> Text -> Text -> IO (Either String Text) Source #

Execute a single tool call Handles tool lookup and input/output conversion.

runSingleStep :: (Agent a, BaseMemory m) => a -> AgentState m -> IO (Either String AgentStep) Source #

Alias for planNextAction

customAnyTool :: Tool a => a -> (Text -> Input a) -> (Output a -> Text) -> AnyTool Source #

Helper for creating custom tool wrappers Requires conversion functions between Text and tool-specific types.