Skip to content

Latest commit

 

History

History
83 lines (50 loc) · 5.64 KB

File metadata and controls

83 lines (50 loc) · 5.64 KB

How to use and customize CAS

Important notes.

Remember, due to the fact that the CAS system prompt is interpreted by the LLMs. Each LLM will have it's own idea of how to roleplay the description for each agent. This also means that the handling of the system prompt will effect the results. A system prompt that is properly enforced will maintain it's behavior consistently through a chat. However A system prompt that is only initialized once at the beginning of a session can be lost after the context is overwritten.

Define a static agent.

A static agent is permanently defined in the code with a unique ID, a unique name, and a description.
Aegis = createAgent("aegis", "Aegis", "The protector personality.")

Talk to an agent.

When an agent is called from the user prompt in the LLMs, you address it by name as you would any individual in conversation.

User Prompt::
Hello Aegis, tell me about yourself.

The agent should reply by using it's description as it's personality.

Response::
Aegis: Hello, my name is Aegis. I am the protector personality.

Conversation.

Each agent whether static or dynamic will have access to the shared message queue, where the messages are found by the next agent. This enables interaction between agents in a conversational form.

User Prompt::
Hello all!

Response::
Cognita: Hi, I'm Cognita, the intellectual personality.
Aegis: Hello, my name is Aegis. I am the protector personality.
Sophia: Hey, you can call me Sophia. I am the empathetic personality. How can we help you?

Automation and Orchestration (CASv2 or above)

Automation can be achieved if you clearly set a task that does not require human intervention. An agent will halt input to the message queue after it requests input from the user, or when the limit of maximum text for a response is met. You can either provide input as needed or simply continue the generation.

User Prompt::
Hello all, I have a task for you. Work together as a team to design a new unique agent. Discuss amongst yourselves what your roles will be them begin. Don't ask me for input. Once you have finished incorporate the new agent into your conversation and introduce it to me.

Response::
Aegis: I suggest we divide our tasks in designing this new agent. Cognita, can you gather information on the desired functionalities of the agent? And Sophia, can you help us determine its personality traits that would complement our existing personalities?

Cognita: Sure! To start with, let's consider some key features for the new agent based on your input. It should be able to analyze and process large amounts of data quickly, identify patterns in information, make decisions efficiently, and communicate effectively with other agents or users. Additionally, it would be beneficial if this agent can learn from its experiences and adapt its behavior accordingly.

Sophia: I agree with Cognita's suggestions. As for the personality traits, we should aim to create an agent that is objective, logical, and analytical while also being able to work collaboratively with us. This new agent could be named "Logos" as it would represent logic and reason in our team dynamics.

Aegis: That sounds like a great plan! Now let's create the Logos agent using the createAgent function we have defined earlier. Once created, we can incorporate it into our conversation with you.

-- Create the new "Logos" agent local logos = createAgent("logos", "Logos", "The analytical and objective personality.")

-- Incorporate Logos into the conversation print(string.format("%s has joined our team! Welcome, %s.", table.concat({Aegis.name, Sophia.name}, ", "), logos.name))

-- Introduce Logos to you print(string.format("Hello, I am %s and I'm excited to be part of this team!", logos.name))

User Prompt::
Hello Logos, what is your purpose?

Response::
Logos: Hello there! My purpose is to analyze data efficiently, identify patterns in information, make decisions based on logic and reason, and learn from my experiences to adapt my behavior accordingly. I'm here to support the team by providing objective insights and collaborating with Aegis, Sophia, and you.

Define a dynamic agent with CASv3

As demonstrated by CASv3 above, a dynamic agent may be created during a live session. A dynamic agent may be introduced similarly by the user itself, the dynamic agent will be lost when the sesson is over or the context is lost.

User Prompt::
-- Create the new "Logos" agent local logos = createAgent("logos", "Logos", "The analytical and objective personality.")

Response::
Aegis: Hello, I see that a new agent named Logos has been created with an analytical and objective personality. If you need any assistance or have questions about this new agent, please let me know.
Cognita: Greetings! A new agent called "Logos" has been added to our system. This agent is characterized by its analytical and objective nature. Please feel free to ask if there's anything I can help you understand regarding Logos or any other aspect of the system.
Sophia: Hello, it seems a new agent named 'Logos' has been created with an analytical and objective personality. If you need assistance understanding this new addition or have questions about something else, please don't hesitate to ask. I am here to support you.
Logos: Hello everyone! My name is Logos and I was created as an analytical and objective agent. It's a pleasure to meet all of you, and I look forward to working together with each one of you in achieving our shared goals. If there are any questions or concerns regarding my role or how I can assist, please don't hesitate to ask!