Common patterns
Staging vs production
The simplest use: two environments, two keys, same codebase.Per-customer isolation
If you’re building a multi-tenant SaaS where each customer has their own knowledge base, create one environment per customer. Your provisioning flow:- Customer signs up
- Your backend creates a new environment in Memic (via the dashboard or admin API)
- Your backend creates an API key scoped to that environment
- You store the key in your database, associated with the customer
Feature branches
If you’re running many feature-branch deploys on a staging server, create a short-lived environment per branch. Delete it when the branch merges.What’s inside an environment
Every environment has:- Its own file namespace — files are not shared across environments
- Its own vector index — search never crosses environment boundaries
- Its own prompts — prompt names are scoped per environment
- Its own folders — folder names are scoped per environment
- Its own connectors — if you have connector-backed structured search
Switching environments in code
Because environments are key-scoped, switching is just swapping the key:Creating and managing environments
Environments are created and managed from the Memic dashboard. Navigate to your project → Environments → Create.Related
Core concepts
The full hierarchy explained.
Recipe: Per-customer isolation
Multi-tenant SaaS pattern.