Lesson 1: Setup & Runtime
Prerequisites
- Node.js v20+ (use
nvm install 20). - Docker with MongoDB or Cosmos emulator if you want durable sessions.
- Nest CLI:
npm i -g @nestjs/cli. - Gemini + optional OpenAI keys.
- A Picoflow developer key.
Environment File
Create medical-appointment-bot/.env:
PICOFLOW_KEY=<picoflow dev key>
GEMINI_KEY=<gemini api key>
OPENAI_KEY=<optional>
LLM_RETRY=3
LLM_TEMPERATURE=0.5
SESSION_EXPIRATION=50000
DOCUMENT_DB=MONGO
MONGODB_URL=mongodb://localhost:27017/?directConnection=true
MONGODB_NAME=picoflow
MONGODB_COLLECTION=sessions
Swap the Mongo block for Cosmos if needed (DOCUMENT_DB=COSMO).
Install & Run
cd medical-appointment-bot
npm install
npm run start:dev
The server listens on http://localhost:8000 and serves Swagger at /api. We’ll wire the flow next.