Skip to main content
team-plain/example-internal-agents holds two working agents. Both answer users in discussions, receive webhooks on a local endpoint, and gate the one action a customer would see behind an approval. They differ in how much of the agent loop they hand to a framework.

The tools

Both agents give the model the same 5 tools, each a call on Plain’s API:
  • list_thread_queue and search_threads: find a thread when the discussion wasn’t opened on one
  • read_customer_thread: paginates timelineEntries and concatenates llmText, as in read the thread
  • search_knowledge: calls searchKnowledgeSources, as in using knowledge
  • reply_to_customer: reports the tool call, asks for approval, waits for the decision, then calls replyToThread

Running one

Each README walks through the setup: a machine user with the Custom agent type, the permissions to grant, a public URL for the webhook target, and the events to subscribe to. From there, open a thread in Plain, click Ask Sidekick, pick your agent, and ask it to help.