AI Setup
LearnHouse includes AI-powered features for learning assistance and content editing, powered by Google Gemini. These features are optional and disabled by default.
LearnHouse uses llama-index with pgvector for RAG (Retrieval-Augmented Generation), enabling AI assistants to answer questions using your course content as context.
Enabling AI
Set the following environment variables in your .env file:
LEARNHOUSE_GEMINI_API_KEY=your-gemini-api-key
LEARNHOUSE_IS_AI_ENABLED=trueTo get a Gemini API key, visit Google AI Studio .
After updating your .env file, restart your instance:
learnhouse stop
learnhouse startAI features require a valid Gemini API key with sufficient quota. Usage costs are billed directly by Google based on the models and volume used.
Models
LearnHouse uses Gemini models directly — the model names are managed by LearnHouse and are not configurable:
gemini-2.5-flash— main assistant responsesgemini-2.0-flash-lite— short tasks such as chat title generation and follow-up suggestions
Per-Organization AI Configuration
Once AI is enabled on the instance, each organization can toggle AI on or off and set usage limits from its admin settings. The Gemini API key itself is set once at deployment via LEARNHOUSE_GEMINI_API_KEY and is shared across organizations.
Usage Limits
You can configure a per-organization request limit to control API costs. When a user exceeds the limit, further AI requests are rejected until the window resets.