Quick Start
Build your first MindedJS agent in minutes! We'll create a customer support agent that can process refunds.
What You'll Build
A customer support agent for an ecommerce store:
Greets customers and asks for order details
Intelligently routes to refund processing when appropriate
Processes refunds with business logic
Maintains conversation state throughout
Project Setup
First, create the necessary files in your project:
1. Agent Configuration
Create minded.json in your project root (see Project Configuration for detailed documentation):
{
"flows": ["./flows"],
"llm": {
"name": "ChatOpenAI",
"properties": {
"model": "gpt-4o"
}
}
}2. Flow Definition
Create flows/refundFlow.yaml:
3. Memory Schema
Create schema.ts:
4. Tools
Create tools/processRefund.ts:
Create tools/index.ts:
5. Main Agent
Create agent.ts:
Project Structure
Your project should look like this:
Run Your Agent
Start the interactive chat session:
This will start an interactive conversation where you can chat with your agent:
Tips:
Type
exitorquitto end the conversationEach message maintains conversation context and memory
The agent will intelligently route to refund processing when appropriate
What Happens
Trigger Activation: The manual trigger receives your input message
Support Agent: The prompt node greets the customer and asks for details
Intelligent Routing: If the customer mentions refunds and provides order details, the flow routes to the refund tool
Refund Processing: The tool processes the refund and updates memory
State Management: Memory persists customer information throughout the conversation
Next Steps
Now that you have a working agent, explore:
Core Concepts - Understand how flows, nodes, and edges work
Node Types - Learn about all available node types
Edge Types - Learn about all available edge types
Tools - Learn about all available tools
Last updated