๐ 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โฆ
๐ 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:
- Name: Unique name for the tool.
- 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. - Parameters: Optional inputs (name, type, description, and required flag).
- Code: JavaScript logic using Johanโs standard structure.
๐งฌ Default Code Structure
const { user, agent } = args;
// Your function logic here
return { message: "" };
userandagentare provided automatically.- Any custom parameters you define will also appear in the
argsobject.
๐ฆ 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
messagekey (even if empty). - Use
system+continuefor 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