Getting Started¶
Prerequisites¶
- Python 3.11+
- Node.js 20.19+ or 22.12+ (required by the Vite 8 frontend toolchain)
- Docker Desktop — download here if you use the local MongoDB container below; optional with an existing MongoDB server
Mozaiks installs Tree-sitter parser packages with the core framework package so Studio can build source-backed App Intelligence for generated and existing apps. No separate parser setup is required.
1. Install¶
For framework development, clone the repository and run python -m pip install -e ".[dev]" instead.
2. Start MongoDB¶
Mozaiks requires a database to store your apps, build history, and workspace state. The easiest way to start one is via Docker:
Start Docker Desktop before running the command below. Skip this step if you already have a reachable MongoDB server. Setting MONGO_URI in step 3 only selects the database; it does not start one.
Don't want Docker?
Use MongoDB Atlas (free tier, cloud-hosted, nothing to install). Set MONGO_URI to your Atlas connection string in step 3.
3. Set environment variables¶
Replace sk-... with your own key and keep the quotes. PowerShell tries to run an unquoted key as a command, producing "not recognized". Do not share your key in terminal transcripts or screenshots.
Run the remaining steps in this same terminal: these environment variables last only for the current session. In a new terminal, set them again or configure the workspace's .env privately.
LLM provider
Builds default to OpenAI with gpt-5-nano; DEFAULT_LLM_MODEL retains that setup's model override. To choose another provider, install its optional package (mozaiks[anthropic] or mozaiks[gemini]), set LLM_PRIMARY_API_TYPE=anthropic or google, set LLM_PRIMARY_MODEL to your intended model, and supply ANTHROPIC_API_KEY or GEMINI_API_KEY. LLM_FALLBACK_ENABLED=false keeps the configuration to that one model.
Using Atlas? Replace MONGO_URI with your Atlas connection string.
4. Create your workspace and open Studio¶
Start in your user folder, or another folder you can write to. Replace my-workspace with your preferred workspace folder name:
The relative --dir path is created inside the terminal's current directory. On Windows, do not create workspaces under C:\Windows\System32 or C:\Program Files; administrator access is not needed.
This scaffolds the workspace, starts the backend and frontend, and opens Studio in your browser at http://127.0.0.1:3000/apps. While it runs, http://localhost:3000 reaches the same Studio.
5. Build your first app¶
- Click Create App
- Describe what you want to build in the chat
- Follow the workflow — the AI guides you through the build steps
- Review the generated app: it is saved as a draft. Accept the draft when it's right, then promote it to make it active
In-progress builds stay in Apps so you can always pick up where you left off.
This first build is your app's Genesis Build; after that, every change you ask for is a Refinement Run against the app you already have. See Genesis Builds and Refinement Runs.
Code Context Infrastructure¶
Mozaiks indexes app source into a SourceContextBundle, AppContextGraph, and AppIntelligenceSnapshot after generated artifacts, App Intelligence indexing, or existing-app discovery. This is automatic and uses Tree-sitter-backed parsing where supported.
For local quickstarts, graph snapshots are stored with Mozaiks artifacts. For team or production deployments with large repositories, plan to run FalkorDB as the graph-query mirror for faster multi-hop queries and Studio visualization. FalkorDB mirrors canonical AppContext and App Intelligence artifacts; it does not replace them.
Coming back to an existing workspace
Use the same workspace path you chose in step 4 and restore the environment variables from step 3 if this is a new terminal. The docker start line is only for the container created in step 2.
Troubleshooting¶
Access is denied / WinError 5
The workspace path points into a protected directory. Return to your user folder with Set-Location $env:USERPROFILE, then rerun step 4. Do not use administrator access to create a workspace inside Windows system folders.
Setup complete, then Backend failed to start
The workspace was created successfully; this message concerns the server process. Keep the workspace. Read the backend error using Local Setup's diagnostic steps, fix that error, then reopen the same workspace with studio --open.
MongoDB connection error
Make sure Docker is running and the MongoDB container is up:
If you used Atlas, double-check the connection string is correct and the cluster is reachable.
mozaiks is not recognized
Use python -m mozaiks instead. The mozaiks shortcut requires your Python scripts directory to be on PATH, which some systems don't configure automatically.
Builds fail or hang
Make sure OPENAI_API_KEY is set in the current shell session; builds call OpenAI only. You can open Studio without a key but builds will not run.
What's Next¶
-
Key Concepts
Workspaces, apps, modules, workflows — the full mental model in one page.
-
CLI Reference
Every
mozaikscommand in one place. -
Use Studio
Learn the workspace and app dashboard surfaces.
-
Guides
Add modules, pages, workflows, integrations, and more.
Contributing to Mozaiks or setting up from a repo checkout? See Local Setup.