Fred is a multi-agent AI assistant to help managing your Kubernetes applications. It consists of a python backend, exposing (fast API) REST endpoints, and a companion UI that provides you with a simple but effective chatbot UI.
Fred is primarly a laboratory to explore how to best design a complete multi-agent application using LangChain and LanGraph. It does not pretend to be a framework, instead it is a complete example that illustrates how to turn several specialized agents into a fully-fledge expert team ready to assist you in answering very precise questions about your K8S application.
Checkout Fred website for details and position papers.
Have a look first at fred website get started.
Simply explained, you need to first start the Python backend as explained here, then the UI as explained here.
Here is the quick procedure for impatient people.
You will need a valid OpenAI API Key with an access to the gpt-4o model - check the OpenAI help topic - How can I access GPT-4, GPT-4 Turbo, GPT-4o, and GPT-4o mini to get one.
You setup everything directly on your machine in bare-metal.
The backends requires Python 3.12.8. We strongly encourage you to use pyenv to install Python.
pyenv install 3.12.8
pyenv global 3.12.8
pyenv versions
system
* 3.12.8 (set by /home/cyrille-biard/.pyenv/version)
A backend/.python-version file is part of the repository to ensure your local development environment match fred requirements.
Note that pyenv takes care of both Python and pip, but not poetry. Poetry 1.7 is required. It will be part of the constructed virtual env. Please use the make command to build it.
cd backend/
make build
The front end requires node v22.13.0.
We strongly encourage you to use nvm to install and manage node.
Similarly use the make command.
cd frontend
make build
Install NVM on Linux Then
Use NVM to install the expected release of nodeJS
nvm install 22.13.0
In one terminal:
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
cd backend
make runIn another terminal:
cd frontend
make runThen open https://localhost:5173 in your local browser.
Watchout: this is WIP. The docker compose make easier to develop the frontend and the backend deploying and configuring the following required compoments for you:
You setup everything on Docker. The provided dockerfiles correctly deals with all requirements issues as well by leveraging the same Makefiles.
- keycloak
- opensearch and opensearch-dashboards
- minio
- a dummy kubernetes cluster
This guarantees we all share the same environments and Docker image.
According to the distribution of your docker host, install the following packages:
- docker, Install Docker Engine
- docker-compose, Overview of installing Docker Compose
- a properly configured kube config file available at ~/.kube/config , for a dev k8s cluster or a Minikube, Install Minikube
If you use a proxy to access to the internet, make sure your workstation won't use it to access to the local or container networks.
export PROXY_URL="<PROXY_URL>"export https_proxy=$PROXY_URL
export http_proxy=$PROXY_URL
export ftp_proxy=$PROXY_URL
export no_proxy=localhost,127.0.0.1,10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,0.0.0.0,$(hostname -i),$(hostname -s),$(hostname -f | tr '[[:upper:]]' '[[:lower:]]')Tips: You can set the lines above into your ~/.bashrc file to set these environment variables when you log in.
You also need to configure the docker daemon to use the proxy.
cat << EOF | sudo tee /etc/docker/daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"proxies": {
"http-proxy": "$PROXY_URL",
"https-proxy": "$PROXY_URL"
}
}
EOFRestart the docker daemon to apply the previous change.
sudo systemctl restart dockerIncrease the vm.max_map_count - this is a requirement for opensearch.
echo "vm.max_map_count=262144" | sudo tee /etc/sysctl.d/10-opensearch.conf
sudo sysctl -pAdd the entry 127.0.0.1 fred-keycloak into your docker host /etc/hosts to be correctly redirected from your web browser.
grep -q '127.0.0.1.*fred-keycloak' /etc/hosts || echo "127.0.0.1 fred-keycloak" | sudo tee -a /etc/hostsEnsure that following commands work
ping fred-keycloack
getent hosts fred-keycloack
Set your OpenAI API Key into the environment variables file ~/.fred/openai-api-key.env that will be used by the backend container.
mkdir ~/.fred
echo "OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>" > ~/.fred/openai-api-key.env(as a reminder, go back to Get Started to get the link to get an OpenAI API Key)
Once your docker host is ready, you can start the docker compose stack. The way to start all containers might depends on your IDE. VSCode has a plugin called Dev Containers that allow to develop directly into the container. But if you do not use VSCode, we provide a script to
You are going to use:
The full environment might take 10-15 minutes to be ready.
Open VSCode and make sure Dev Containers plugin is installed.
Then in VSCode:
- Press the
F1key - Select
Dev Containers: Reopen in Container(orDev Containers: Rebuild and Reopen in Container) - Wait until all containers are up and running, and the VSCode extensions are installed in the dev container
- Open the Run and Debug panel on the left (shortcut:
Ctrl+Shift+D) - Select Run Backend, click the Play button, and wait for the process to start. It should be listening on port
8000 - Do the same for Run Frontend, and wait until Vite has started and is listening on port
5173
Start all containers with this command:
chmod u+x ./deploy/docker-compose/fred-compose.sh
./deploy/docker-compose/fred-compose.sh startIf you make changes on frontend code, it will be applied without restarting the container.
If you make changes on backend code, you will have to restart the container to apply your changes. Restart it with this command:
docker restart fred-backendSome default users are already available and they can connect to fred, opensearch-dashboards and minio:
- Administrator user :
alice - Editor user :
bob - Viewer user :
phil
Hereunder the configuration of the following components required by fred:
-
Keycloak:
- URL: http://localhost:8080
- Admin service account:
admin
-
Opensearch:
- URL: http://localhost:5601
- Indice:
localvector - Admin service account:
admin - Read only service account:
fred_ro - Read write service account:
fred_rw
-
MinIO:
- API URL: http://localhost:9000
- WebUI URL: http://localhost:9001
- Bucket:
fred-dev-content - Admin service account:
admin - Read only service account:
fred_ro - Read write service account:
fred_rw
All passwords are Azerty123_ for this ephemeral and local development stack.
cd backend
make docker-build
make docker-run
cd ../frontend
make docker-build
make docker-run
Documentation is available at https://fredk8.dev.
If you are interested in contributing to the project, start by reading the Contributing guide.
Fred is apache V2. Checkout the LICENSE for details