This document describes the core top-level functions used to interact with the Common Lisp Chatbot environment from the REPL, as well as how to configure persistent personas.
The most common way to interact with the chatbot is using the chat function.
Sends a prompt to the active conversation and returns the response string.
Basic Usage:
(chat "Hello, who are you?")
Keyword Arguments:
:conversation- Target a specific conversation object instead of the default active conversation.:file/:files- Attach local files or remote URLs to the prompt.:temperature/:top-p- Override the sampling parameters for this specific turn.:callback- Provide a function to receive text tokens as they stream in real-time.
Creates a fresh conversation state. Useful when you want to clear the history without loading a specific persona.
Basic Usage:
(new-chat :backend :gemini :model "gemini-1.5-pro")
(setf (current-default-conversation) (new-chat :backend :gemini :model "gemini-1.5-pro"))
A "persona" is a persistent configuration that defines a chatbot's backend, model, system instructions, and optional tools. Personas are stored in your home directory under ~/.Personas/.
To create a persona named MyPersona, create the following directory structure:
~/.Personas/MyPersona/
config.lisp
system-instructions.md (or system-instructions)
This file contains a single Lisp property list (plist) defining the persona's settings.
Example config.lisp:
(:backend :gemini
:model "gemini-1.5-pro"
:temperature 0.7
:enable-filesystem-tools t
:enable-eval t
:enable-web-tools t)
This file contains the plain text Markdown instructions that tell the AI who it is and how to behave.
Loads a persona from the ~/.Personas/ directory and creates a new conversation using its configuration.
Basic Usage:
(setf (current-default-conversation) (new-chat-persona "MyPersona"))
Once loaded, subsequent calls to chat will automatically route to this newly instantiated persona conversation unless overridden.
You can also spawn personas into a named registry for easy multi-agent or background tasking.
spawn-persona: Loads a persona and binds it to a specific registry name.list-personas: Lists all active personas in the registry.remove-persona: Removes a persona from the registry.
Passes a prompt sequentially to a configured list of participants, allowing multiple personas to weigh in on the same conversation thread.
Forces multiple personas to debate or respond to each other's outputs for a specified number of rounds.