kaiban-ai / KaibanJS

KaibanJS is a JavaScript-native framework for building and managing multi-agent systems with a Kanban-inspired approach.
https://www.kaibanjs.com/
MIT License
453 stars 24 forks source link

Feature/custom agent prompts #75

Closed darielnoel closed 1 month ago

darielnoel commented 1 month ago

Custom Agent Prompts

Description

This PR implements the ability to customize agent prompts in KaibanJS, allowing developers to tailor the behavior and responses of AI agents to specific use cases or requirements.

Changes

How to Use

Developers can now provide custom prompt templates when initializing an agent:

const customPrompts = {
    SYSTEM_MESSAGE: ({ agent, task }) => Custom system message for ${agent.name}...,
    INITIAL_MESSAGE: ({ agent, task }) => Custom initial message for task: ${task.description}...,
    // ... other custom prompts
};
const agent = new Agent({
    // ... other agent properties
    promptTemplates: customPrompts
});

Testing

Documentation

Related Issues

Closes #38

Checklist

Additional Notes

This feature enhances the flexibility of KaibanJS, allowing for more tailored AI agent interactions. It's important to note that while custom prompts offer greater control, they should be used judiciously to maintain consistency across the application.