> For the complete documentation index, see [llms.txt](https://vibemx.gitbook.io/neuronai-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vibemx.gitbook.io/neuronai-studio/knowledge-bases/creating-and-ingest.md).

# Creating & Ingest

## Create a knowledge base

1. Open **Knowledge Bases** → **New**.
2. Set **name**, optional **description**.
3. Choose **embeddings provider/model** (defaults come from `config/neuronai-studio.php` → `rag.*`).
4. Choose a **vector store** driver and fill driver-specific settings.
5. Optionally override **Top K** and **similarity threshold**.
6. Save.

See [Vector stores](/neuronai-studio/knowledge-bases/vector-stores.md) for driver credentials and optional packages.

## Ingest

On the edit screen:

* **Upload** — txt, md, pdf, html (max size follows Livewire upload limits)
* **Paste text** — optional document name

Source files (uploads and pasted text) are persisted under `rag.documents_path` on `rag.documents_disk` so you can **Reindex** later.

| Status       | Meaning                           |
| ------------ | --------------------------------- |
| `pending`    | Queued for async ingest           |
| `processing` | Chunking / embedding in progress  |
| `completed`  | Indexed in the vector store       |
| `failed`     | See the error on the document row |

### Async vs sync

By default (`NEURONAI_STUDIO_RAG_ASYNC_INGEST=true`) the UI queues `IngestKnowledgeDocumentJob`. Set the env to `false` to run ingest inline (useful for local debugging).

### Chunking

Defaults:

| Config                    | Env                                       | Default |
| ------------------------- | ----------------------------------------- | ------- |
| `rag.chunk.max_words`     | `NEURONAI_STUDIO_RAG_CHUNK_MAX_WORDS`     | `200`   |
| `rag.chunk.overlap_words` | `NEURONAI_STUDIO_RAG_CHUNK_OVERLAP_WORDS` | `20`    |

Empty PDFs (no extractable text) fail with a clear error — paste text or fix extraction (`pdftotext`) instead.

## Reindex & delete

* **Reindex** — removes existing vectors for that document (`deleteBy`) and re-embeds from the stored file.
* **Delete document** — removes vectors and the Eloquent row (and stored source file).
* **Delete knowledge base** — cleans documents, vectors, and the local `.store` file when using the `file` driver.

## Next steps

* [Retrieval preview & RAG node](/neuronai-studio/knowledge-bases/retrieval.md)
* [Agent binding](/neuronai-studio/knowledge-bases/agent-binding.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vibemx.gitbook.io/neuronai-studio/knowledge-bases/creating-and-ingest.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
