Configuration
Customize search and indexing behavior
Configuration
Project Settings
Project settings are managed from the Settings page in the dashboard. These control how documents are indexed and how search queries are processed.
Embedding
| Setting | Default | Description |
|---|---|---|
| Embedding model | text-embedding-3-small | Model used to embed documents and queries |
Chunking
| Setting | Default | Description |
|---|---|---|
| Chunk size | 1024 | Maximum token count per chunk |
| Chunk overlap | 200 | Token overlap between adjacent chunks |
Retrieval
| Setting | Default | Description |
|---|---|---|
| Match threshold | 0.3 | Minimum cosine similarity score (0-1) |
| Max results | 10 | Maximum number of results to return |
| BM25 search | off | Enable hybrid BM25 keyword search alongside vector search |
| Reranking | off | Enable reranking of search results using a cross-encoder model |
When BM25 search is enabled, both vector similarity search and BM25 keyword search run in parallel. Results are merged, deduplicated by document, and the higher score is kept. This improves recall for keyword-heavy queries while preserving semantic search quality.
Generation
| Setting | Default | Description |
|---|---|---|
| AI Provider | — | Select a registered AI provider (configured at the team level) |
| Generation model | Depends on provider | Model used to generate AI answers |
| System prompt | Built-in | System prompt for the LLM |
AI Providers are registered at the team level from the AI Providers page. Each provider has its own API credentials and supported models. Project settings reference these providers via dropdown — no API keys are stored at the project level.
Search Parameters
These parameters can be passed in the request body for /search and /ai-search to override project defaults per-request:
| Parameter | Type | Default | Description |
|---|---|---|---|
query | string | required | The search query |
max_num_results | number | Project setting | Maximum chunks to return |
score_threshold | number | Project setting (0.3) | Minimum similarity score (0-1) |
include_steps | boolean | false | Include internal step trace in the response |
filters | object | null | Metadata filters (see Filtering) |
AI Search Parameters
Additional parameters for /ai-search:
| Parameter | Type | Default | Description |
|---|---|---|---|
stream | boolean | false | Enable SSE streaming responses |
include_steps | boolean | false | Include internal step trace |
Filtering by Metadata
Filter results using document attributes:
{
"query": "How do I deploy?",
"filters": {
"type": "and",
"filters": [
{ "key": "folder", "value": "guides/" }
]
}
}Filter Types
| Type | Description |
|---|---|
and | All conditions must match |
or | Any condition must match |
Filter Conditions
| Key | Description |
|---|---|
folder | Document folder path prefix (auto-generated from filename) |
| Custom keys | Any attribute set during document upload |
Document Attributes
Attach custom metadata when uploading documents:
curl -X POST https://brain.aistack.run/api/v1/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@guide.md" \
-F "filename=docs/guide.md" \
-F 'attributes={"author":"alice","version":"2.0"}'These attributes can then be used in search filters.
Upload Filtering
Upload filtering lets you automatically reject files based on glob patterns before they are stored or indexed. This is useful for keeping unwanted files (build artifacts, lock files, environment files, etc.) out of your project.
Default Ignore Patterns
The following patterns are always enforced and cannot be disabled. Files matching any of these are silently skipped:
**/node_modules/** **/.git/** **/.svn/**
**/.hg/** **/.DS_Store **/Thumbs.db
**/*.lock **/package-lock.json
**/yarn.lock **/pnpm-lock.yaml
**/bun.lockb **/.env **/.env.*
**/*.log **/*.min.js **/*.min.css
**/*.map **/*.d.tsPer-Project Patterns
You can configure additional patterns per project in the dashboard under Settings > Upload Filters:
- Ignore patterns -- Additional glob patterns to reject. These work alongside the default patterns.
- Allow patterns -- If set, only files matching at least one allow pattern are accepted. Leave empty to allow all non-ignored files.
Evaluation Order
1. Check default ignore patterns -> skip if matched
2. Check project ignore patterns -> skip if matched
3. If project allow patterns exist:
File must match at least one -> skip if not
4. Allow uploadIgnore patterns always take precedence over allow patterns.
Skipped Response
When a file is filtered, the API returns HTTP 200 with:
{
"skipped": true,
"reason": "File matches default ignore pattern: **/.env"
}No document is created, no storage is used, and no indexing is triggered.