You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Built on Supabase for reliable, scalable vector storage. Fast semantic search with configurable similarity thresholds and match counts.
195
+
Built on PostgreSQL with pgvector for reliable, scalable vector storage. Works with any Postgres provider (Supabase, Neon, self-hosted). Fast semantic search with configurable similarity thresholds and match counts.
196
196
</div>
197
197
</div>
198
198
</div>
@@ -238,7 +238,7 @@ import { Separator } from "@/components/ui/separator";
default: 'Mimir - Contextual RAG for Code & Documentation',
15
15
template: '%s | Mimir',
16
16
},
17
-
description: 'Mimir is a comprehensive contextual RAG (Retrieval Augmented Generation) system with MCP integration. Ingest code and documentation from multiple GitHub repositories into Supabase vector store. Supports TypeScript, Python, and more. OpenAI-compatible API and MCP protocol for AI assistants.',
17
+
description: 'Mimir is a comprehensive contextual RAG (Retrieval Augmented Generation) system with MCP integration. Ingest code and documentation from multiple GitHub repositories into PostgreSQL (pgvector). Supports TypeScript, Python, and more. OpenAI-compatible API and MCP protocol for AI assistants.',
Your Supabase project's API endpoint. Mimir uses it to connect to your database and store/query vector embeddings. Find this in your Supabase dashboard under Project Settings → API → "Project URL".
62
+
Your PostgreSQL connection string. Mimir uses it to connect directly to your database and store/query vector embeddings.
60
63
61
-
#### Supabase Service Role Key (required)
64
+
<InfoCard>
65
+
**Docker and managed Postgres (Supabase, Neon, etc.):** If the container cannot reach your database, run with **host network**: `docker run --rm --network host -v $(pwd)/.env:/app/.env:ro mimir-rag:local`. That uses the host's network and usually clears connection issues. Alternatively, for Supabase use the **Session Pooler** connection string (port 6543) from Dashboard → Settings → Database → Connection Pooling → Session mode.
This key gives Mimir full access to your Supabase database. It's needed to create tables, insert embeddings, and perform vector searches. Find it in Supabase dashboard → Project Settings → API → "service_role" key (not the "anon" key).
70
+
The default schema uses `vector(3072)` for embeddings. If your embedding model uses a different dimension, update the database schema:
68
71
69
-
**⚠️ Security Note:** This key has full database access. Never commit it to version control or expose it publicly.
2. Update `prisma/migrations/0_init/migration.sql` to change `vector(3072)` to your model's dimension
74
+
3. Update `prisma/schema.prisma` to change `Unsupported("vector(3072)")` to match
75
+
4. Run migrations: `make setup-db`
70
76
71
-
#### Supabase Table (optional)
77
+
#### Similarity Threshold (optional)
72
78
73
79
```tsx
74
-
MIMIR_SUPABASE_TABLE=docs
80
+
MIMIR_DATABASE_SIMILARITY_THRESHOLD=0.2
75
81
```
76
82
77
-
**Default:**`"docs"`
83
+
**Default:**`0.2`
84
+
**Range:** 0.0 to 1.0
78
85
79
-
Specifies which table in your Supabase database stores the document chunks. Use different table names if you have multiple Mimir instances or want to separate different documentation sets.
86
+
Controls how similar a document chunk must be to your query to be included in results. Lower values (0.1-0.3) return more results but may include less relevant content. Higher values (0.5-0.8) return fewer, more precise matches.
80
87
81
-
#### Supabase Database Password (optional)
88
+
#### Match Count (optional)
82
89
83
90
```tsx
84
-
MIMIR_SUPABASE_DB_PASSWORD=your-database-password
91
+
MIMIR_DATABASE_MATCH_COUNT=10
85
92
```
86
93
87
-
Mimir can automatically construct the full database connection URL from your Supabase URL and password. If provided, Mimir combines this with `MIMIR_SUPABASE_URL` to create `DATABASE_URL` automatically.
94
+
**Default:**`10`
88
95
89
-
#### Similarity Threshold (optional)
96
+
Limits how many document chunks are returned per query from vector search. More chunks provide more context but increase API costs and response time. Fewer chunks are faster but may miss relevant information.
97
+
98
+
#### BM25 Match Count (optional)
90
99
91
100
```tsx
92
-
MIMIR_SUPABASE_SIMILARITY_THRESHOLD=0.2
101
+
MIMIR_DATABASE_BM25_MATCH_COUNT=10
93
102
```
94
103
95
-
**Default:**`0.2`
96
-
**Range:** 0.0 to 1.0
104
+
**Default:**`10`
97
105
98
-
Controls how similar a document chunk must be to your query to be included in results. Lower values (0.1-0.3) return more results but may include less relevant content. Higher values (0.5-0.8) return fewer, more precise matches.
106
+
Limits how many document chunks are returned per query from full-text (BM25) search. Used when hybrid search is enabled.
99
107
100
-
#### Match Count (optional)
108
+
#### Enable Hybrid Search (optional)
101
109
102
110
```tsx
103
-
MIMIR_SUPABASE_MATCH_COUNT=10
111
+
MIMIR_DATABASE_ENABLE_HYBRID_SEARCH=true
104
112
```
105
113
106
-
**Default:**`10`
114
+
**Default:**`true`
107
115
108
-
Limits how many document chunks are returned per query. More chunks provide more context but increase API costs and response time. Fewer chunks are faster but may miss relevant information.
116
+
When enabled, combines vector similarity search with full-text (BM25) search for better results. Disable if you only want vector search.
109
117
110
118
<divclassName="my-6">
111
119
<Separator />
@@ -117,7 +125,7 @@ Mimir fetches code and documentation from GitHub repositories. You can configure
117
125
118
126
### Single Repository
119
127
120
-
For most projects, start with a single repository:
128
+
For most projects, start with a single repository that contains both code and documentation:
**MIMIR_GITHUB_URL:** The main repository URL. Mimir will fetch both code and documentation from here.
137
+
**MIMIR_GITHUB_URL:** The main repository URL. Mimir will fetch both code and documentation from here. Required for single-repo setup. Optional if using separate code/docs repos or multiple repos.
**Note:** When using `MIMIR_GITHUB_CODE_URL` or `MIMIR_GITHUB_DOCS_URL`, those take precedence over `MIMIR_GITHUB_URL` for that type. `MIMIR_GITHUB_URL` is used as a fallback if neither `MIMIR_GITHUB_CODE_URL` nor `MIMIR_GITHUB_DOCS_URL` is set.
173
+
156
174
<InfoCard>
157
175
**DIRECTORY:** Base directory to start from. If your code is in `src/`, set this to `src` to avoid indexing root-level files.
**Note:** When using multiple repos (numbered variables), the single-repo variables (`MIMIR_GITHUB_CODE_URL`, `MIMIR_GITHUB_DOCS_URL`) are ignored. Number repos starting from 1 and increment sequentially (1, 2, 3, etc.). Each repo can have its own `DIRECTORY`, `INCLUDE_DIRECTORIES`, and `EXCLUDE_PATTERNS` settings.
212
+
192
213
<InfoCard>
193
214
**EXCLUDE_PATTERNS:** Comma-separated patterns to skip. Useful for excluding test files, build artifacts, or generated code.
194
215
</InfoCard>
@@ -243,11 +264,43 @@ Prevents test files and other non-production code from being indexed. This keeps
243
264
244
265
Common test patterns are excluded automatically if not specified.
245
266
267
+
#### Include Directories (optional)
268
+
269
+
```tsx
270
+
MIMIR_GITHUB_INCLUDE_DIRECTORIES=src,lib,packages
271
+
```
272
+
273
+
Comma-separated list of directories to include when parsing. Only files in these directories will be indexed. Useful for large repositories where you only want specific folders.
274
+
246
275
<divclassName="my-6">
247
276
<Separator />
248
277
</div>
249
278
250
-
## 5. LLM Configuration
279
+
## 5. Documentation Configuration (Optional)
280
+
281
+
Configure how documentation URLs are generated in search results.
282
+
283
+
#### Documentation Base URL (optional)
284
+
285
+
```tsx
286
+
MIMIR_DOCS_BASE_URL=https://docs.example.com
287
+
```
288
+
289
+
The base URL where your documentation is hosted. Used to generate clickable links in search results when repository paths don't have per-repo `BASE_URL` configured.
290
+
291
+
#### Documentation Content Path (optional)
292
+
293
+
```tsx
294
+
MIMIR_DOCS_CONTENT_PATH=content/docs
295
+
```
296
+
297
+
The path prefix in your repository where documentation content lives. Used to correctly map repository paths to documentation URLs.
298
+
299
+
<divclassName="my-6">
300
+
<Separator />
301
+
</div>
302
+
303
+
## 6. LLM Configuration
251
304
252
305
Mimir uses LLMs for two purposes: creating embeddings (vector representations) and generating chat responses. You can use different providers for each.
253
306
@@ -331,6 +384,25 @@ MIMIR_LLM_CHAT_TEMPERATURE=0
331
384
332
385
Controls randomness (0.0 to 2.0). Lower values (0-0.3) give more deterministic, factual answers. Higher values (0.7-1.0) give more creative responses.
333
386
387
+
#### Chat Max Output Tokens (optional)
388
+
389
+
```tsx
390
+
MIMIR_LLM_CHAT_MAX_OUTPUT_TOKENS=8000
391
+
```
392
+
393
+
**Default:**`8000`
394
+
395
+
Maximum number of tokens the chat model can generate in a single response. Increase for longer responses, decrease to limit response length.
Copy file name to clipboardExpand all lines: mimir-docs/content/docs/deployment.mdx
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,19 @@ docker run --rm \
34
34
mimir-rag:latest
35
35
```
36
36
37
+
### Database connection from Docker
38
+
39
+
If the container cannot reach your database (e.g. connection timeouts or "Not IPv4 compatible" with Supabase/Neon), run the image with **host network mode**. The app then uses the host’s network and can connect to the DB without changing your connection string:
40
+
41
+
```bash
42
+
docker run --rm \
43
+
--network host \
44
+
--env-file .env \
45
+
mimir-rag:latest
46
+
```
47
+
48
+
With host network, the app listens on port 3000 on the host; omit `-p 3000:3000`. On Linux this usually resolves DB connection issues. On macOS/Windows, host network behaves differently—prefer the Session Pooler (port 6543) for Supabase or a connection string that works from inside the container.
49
+
37
50
<divclassName="my-6">
38
51
<Separator />
39
52
</div>
@@ -79,11 +92,12 @@ Hetzner is a popular choice for deploying Mimir due to its simplicity and cost-e
79
92
```bash
80
93
docker run -d \
81
94
--name mimir-rag \
82
-
-p 3000:3000 \
95
+
--network host \
83
96
--env-file .env \
84
97
--restart unless-stopped \
85
98
mimir-rag:latest
86
99
```
100
+
Using `--network host` avoids database connection issues with managed Postgres (Supabase, Neon, etc.). The server listens on port 3000 on the host; do not use `-p 3000:3000` when using host network.
87
101
88
102
That's it! Your Mimir instance is now running on Hetzner.
89
103
@@ -145,7 +159,7 @@ Deploy Mimir on your own infrastructure for full control.
145
159
### Requirements
146
160
147
161
- Node.js 20 or later
148
-
- Access to Supabase database
162
+
- Access to PostgreSQL database with pgvector extension
149
163
- LLM provider API keys
150
164
- Process manager (PM2 recommended)
151
165
@@ -193,7 +207,7 @@ pm2 startup
193
207
Before deploying to production:
194
208
195
209
-[ ] Generate a secure API key
196
-
-[ ] Set up Supabase with proper security settings
210
+
-[ ] Set up PostgreSQL database with proper security settings
197
211
-[ ] Configure GitHub webhook secret (if using webhooks)
198
212
-[ ] Set appropriate similarity threshold and match count
199
213
-[ ] Configure exclude patterns to avoid indexing test files
@@ -226,5 +240,5 @@ Expected response:
226
240
227
241
Mimir is stateless and can be scaled horizontally:
228
242
- Run multiple instances behind a load balancer
229
-
- All instances share the same Supabase database
243
+
- All instances share the same PostgreSQL database
230
244
- Use sticky sessions if needed (not required for most use cases)
0 commit comments