Skip to content

Agent chat algorithm

Christopher David edited this page Mar 20, 2024 · 2 revisions

As of March 20

  • /chat/{id} loads Livewire Chat
  • On user chat input:
    • Add Message to Thread
    • Create a RunService
    • Call $runService->triggerRun() and save output as response
      • Creates a new Run and calls its trigger method
        • Check to see if we should override the node flow with a semantic route
          • Vectorize the input with Mistral
          • Compare vector by similarity search with semantic routes
          • If a route is matched (imagegen, bitcoin price, finance, shitcoin), send down that route (flow or rejection message), otherwise continue
        • Loop through the flow of nodes, passing user input to the first, and passing each's output as input to the next, returning the final output
          • Call each node's trigger method
            • Current node types: inference, finnhub_function_call, stability_text_to_image, plugin
Clone this wiki locally