Status: [UNTESTED] Endpoints found: http://localhost:9000/chat Source: https://github.com/Simba3696/deskbuddy # DeskBuddy A minimal tool-calling chat agent. Ask it a question, and it can call tools (calculator, current date/time) to answer, with conversation history kept per session in Redis. Generation runs on [Groq](https://console.groq.com/keys)'s free OpenAI-compatible API. ## How it works - `agent/app.py` — a FastAPI service exposing `POST /chat`. It loads the session's prior messages from Redis, sends them plus the new message to the LLM with tool definitions, executes any tool calls the model requests by calling the `tools` service over HTTP, feeds the results back to the model (up to 5 rounds), and appends the new turn to Redis. - `tools/app.py` — a FastAPI service exposing the actual tools: `POST /calculator` (evaluates a math expression) and `GET /datetime` (returns the current date/time). - `redis` — stores per-session chat history as a list under `history:`. - Generation uses Groq's OpenAI-compatible API (`llama-3.3-70b-versatile`), so it works with a free Groq API key — no OpenAI billing required. ## Prerequisites - Docker and Docker Compose - A free [Groq API key](https://console.groq.com/keys) ## Setup 1. Copy the example env file and fill in your key: ```bash cp .env.example .env ``` ```env GROQ_API_KEY=your_groq_api_key_here GROQ_API_BASE_URL=https://api.groq.com/openai/v1 ``` 2. Start the stack: ```bash docker compose up --build ``` ## Usage Send a chat message: ```bash curl -X POST http://localhost:9000/chat \ -H "Content-Type: application/json" \ -d '{"session_id": "demo", "message": "What is 47 * 89?"}' ``` Response: ```json {"reply": "The result of 47 * 89 is 4183."} ``` Send another message with the same `session_id` and the agent remembers earlier turns (via Redis). ## Project layout ``` agent/ app.py FastAPI service: chat endpoint, tool-calling loop, Redis history requirements.txt Agent dependencies Dockerfile Agent container image tools/