โ† Back to list

๐Ÿš€ How to Build Your First Agent on Johan.Chat: A Quick Guide for Beginners

If youโ€™re new to Johan.Chat and want to build your first agent quickly, this guide will help you get started. Johan is a low-code platformโ€ฆ

Johan ยท 2025-09-16 01:28 ยท 0 claps ยท 2.4 min read
#ai-agent #llm-agent #agents #ai #mcp-server
Open on Medium โ†—
Wiki topics: LLM ยท Large Language Models AGT ยท AI Agents AI ยท AI ยท General

๐Ÿš€ How to Build Your First Agent on Johan.Chat: A Quick Guide for Beginners

If youโ€™re new to Johan.Chat and want to build your first agent quickly, this guide will help you get started. Johan is a low-code platform based on the concept of Agents as Code (AaC), allowing you to create intelligent, conversational agents with minimal code โ€” and maximum flexibility.

๐Ÿงฑ 1. Creating Your First Agent

After creating a new agent on the Home screen, youโ€™ll be taken to the Studio, where you can configure the agentโ€™s context, behavior, and tools.

๐Ÿง  2. Understanding the Studio

Inside the Studio, youโ€™ll find several tabs that define how your agent thinks and behaves.

๐Ÿ”น Context

Write a brief, generic description of your agentโ€™s role. This helps the model understand what the agent is generally supposed to do.

๐Ÿ”น Instructions

A list of imperative statements that act like behavioral rules. Example: Always answer using the most recent data available.

๐Ÿ”น Behavior

This is where you write the โ€œsystem promptโ€ โ€” a more detailed set of instructions or persona behavior. Supports Markdown.

๐Ÿ”น Notes

Short context blocks triggered based on input similarity. Each note includes a title and text. This helps keep the agentโ€™s context focused and clean.

๐Ÿ’ก Tip: Use Notes for modular, relevant context that doesnโ€™t need to be always active. Proper separation between Context, Instructions, Behavior, and Notes greatly improves agent performance.

๐Ÿงฐ 3. The Tools Tab

Your agentโ€™s capabilities live here. There are two types:

โœ… Custom Functions

Custom low-code actions you create using JavaScript. Great for calling APIs, triggering logic, or returning dynamic data.

๐Ÿงฉ Plugins

More advanced features built via CLI โ€” only available to companies with a commercial license.

๐Ÿง‘โ€๐Ÿ’ป 4. Creating a Custom Function (Tool)

To build a new function:

  1. Name: Unique name for the tool.
  2. Description: This tells the agent when to use the tool. Example: "Fetch user's balance" โ€” the agent will learn to call this when the user asks for their balance.
  3. Parameters: Optional inputs (name, type, description, and required flag).
  4. Code: JavaScript logic using Johanโ€™s standard structure.

๐Ÿงฌ Default Code Structure

const { user, agent } = args;

// Your function logic here

return { message: "" };
  • user and agent are provided automatically.
  • Any custom parameters you define will also appear in the args object.

๐Ÿ“ฆ Example: Static Response (Basic)

const { user, agent } = args;

return fetch('https://api.yourdomain.com/balance')
  .then(response => {
    if (!response.ok) throw new Error('Request Error');
    return response.json();
  })
  .then(data => {
    return { message: `Your balance is $ ${data.balance}` };
  })
  .catch(error => {
    return { message: `Unable to fetch balance. Please try again later.` };
  });

๐Ÿ” Example: Dynamic Response with system and continue

If you want a more intelligent, multi-turn reply, use system and continue.

const { user, agent } = args;

return fetch('https://api.yourdomain.com/balance')
  .then(response => {
    if (!response.ok) throw new Error('Request Error');
    return response.json();
  })
  .then(data => {
    return {
      message: `Let me check your balance...`,
      system: JSON.stringify(data),
      continue: true
    };
  })
  .catch(error => {
    return { message: `Unable to fetch balance. Please try again later.` };
  });

In this case, the agent receives the data via system and continues the conversation based on it.

โœ… Best Practices

  • Avoid await โ€” use .then() and .catch() for safe execution inside tools.
  • Always return an object with at least a message key (even if empty).
  • Use system + continue for contextual, dynamic conversations.
  • Use descriptive tool names and parameter definitions to guide the agentโ€™s reasoning.

๐ŸŽฏ Conclusion

Johan.Chat makes building conversational agents intuitive and scalable. Its low-code approach and powerful context tools allow you to go from idea to implementation in minutes. Today, you learned how to build your first agent and write your first custom function.

โœจ In the next posts, weโ€™ll explore advanced topics like sending images, uploading documents, and using plugins for more robust integrations.


๋ฉ”ํƒ€๋ฐ์ดํ„ฐ
post_id
32d75fe98e7e
slug
how-to-build-your-first-agent-on-johan-chat-a-quick-guide-for-beginners-32d75fe98e7e
url
https://medium.com/@me_13073/how-to-build-your-first-agent-on-johan-chat-a-quick-guide-for-beginners-32d75fe98e7e
canonical_url
https://medium.com/@me_13073/how-to-build-your-first-agent-on-johan-chat-a-quick-guide-for-beginners-32d75fe98e7e
author_url
https://medium.com/@me_13073
status
ok
fetched_at
2026-07-17 12:26:46