-
Install nix
-
To test installation, run
echo $PATH
and ensure{...}/.nix-profile/bin
is the first element; if not, tryexport PATH=$HOME/.nix-profile/bin:$PATH
-
Make sure you have the nix-pkgs channel set, ie.
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
- If it's the first time running after pulling changes, run "just install" to install all dependencies.
- Set the OPENAI_API_KEY environment variable in your shell.
- Run
just shell
to run the nix and poetry shells. - For the play-coplay agent, run
just play {gradio, repl, zulip, discord}
. Default mode if you don't provide one will create a link to a gradio UI. (for zulip or discord, see extra configuration below.) - To summon a twin with a prompt, run
just summon <prompt-file-path> {gradio, repl, zulip, discord}
. - To start an ontology agent, run
just ontology <path-to-knowledge-base> {gradio, repl, zulip, discord}
. This will allow you to ask questions over the knowledge base you provide. Protip: make sure the knowledge base does not have nested directories. scripts/copy_files_flat.sh can help with this.
-
The agent_config.json file in this directory is a sample configuration file. Copy it to ~/agent_config.json.
-
DISCORD: If you want to the agent's index to be constructed from channels on a discord server, add the relevant discord channel IDs to the
CHANNEL_IDS
variable in agent_config.json. Make sure you set the INDEX_MODE variable to either "discord" or "directory". In order for the channels to be read, you need to set theDISCORD_TOKEN
environment variable to your discord bot's API key. If you're otherwise running as a discord bot, you also need to set theDISCORD_TOKEN
environment variable to your bot's API key. -
ZULIP: If running a zulip agent, you will also need a zulip config file. Go to Zulip and navigate to 'Settings' --> 'Personal Settings' --> 'Bots'. Download the zuliprc file and copy it to ~/zuliprc.
- To exit the poetry shell, type
exit
- To exit the nix shell, use
Ctrl + d
- If you need to reinstantiate your env, do
poetry env list
and then paste the outputted env intopoetry env remove {env-name}
. Then, runpoetry install
andpoetry shell
again to instantiate a new env.
nix
and poetry
allow for packaging for serverless execution with reliable system, package, and other application dependencies like Secrets correctly derived for individual agent
runtime environment.