cogency.nodes

Functions

memorize

Memorize content if it meets certain criteria.


memorize(
  state: cogency.types.AgentState,
  *,
  memory: cogency.memory.base.BaseMemory
) -> cogency.types.AgentState
                    

react_loop_node

ReAct Loop Node: Full multi-step reason → act → observe cycle until task complete.


react_loop_node(
  state: cogency.types.AgentState,
  llm: cogency.llm.base.BaseLLM,
  tools: Optional[List[cogency.tools.base.BaseTool]] = None,
  prompt_fragments: Optional[Dict[str, str]] = None,
  config: Optional[Dict] = None
) -> cogency.types.AgentState
                    

select_tools

Intelligently select a subset of tools based on the user query.


select_tools(
  state: cogency.types.AgentState,
  llm: cogency.llm.base.BaseLLM,
  tools: Optional[List[cogency.tools.base.BaseTool]] = None
) -> cogency.types.AgentState