How to use new AI API
This guide explains on how to use new ai agent API of Peaka
Architecture
Peaka text2SQL agent has a new version which is written with popular agent library LangGraph.
Previous implementation was using tool based implementation new version uses workflow based approach to get more predictable results.
Below you can see workflow of the agent. Peaka AI agent is a workflow implemented in LangGraph.
Internal state of agent
Below you can see internal state of the agent and its description. When agent completes a given task it updates the internal state. If agent provides answer to the user it is added to messages
state.
Stream Modes
You can stream agent internal state via stream modes.
Currently we have these stream modes: When using the stream and methods with LangGraph, you can one or more streaming mode which allow you to control the type of output that is streamed. The available streaming modes are:
values
: Emit all values of the state for each step.updates
: Emit only the node name(s) and updates that were returned by the node(s) after each step.debug
: Emit debug events for each step.messages
: Emit LLM messages token-by-token.
Default stream mode is messages
.