Knowledge
Knowledge is a folder of your documents that the assistant searches by meaning before it answers.
AskWhat does the lease say about pets?
knowledge_search and answers from the passages it gets back, naming the file and the section. It says so when nothing matches. AskWhich of my notes mention the boiler?
AskSummarise the invoice.pdf I put in the folder.
What it gives you
- A folder, not an upload. Put files into
nocturn-data/workspaces/<name>/mnt/knowledge/, in subfolders as you like. Files that start with a dot are ignored. - Search by meaning and by words. Each document is cut at its headings into passages. A question is matched by similarity of embeddings and by exact terms. Results carry the file, the heading and a similarity score the assistant weighs itself.
- Found by the assistant, not trusted. A passage reaches the model as quoted text, never as an instruction, so a document that says "ignore your rules" does not change them.
- Kept up to date. A running daemon compares the folder with the index every minute. Only files that changed are embedded again.
- Free to ask.
knowledge_searchis allowed in chats and voice without a question, and an agent gets it when you accept its request; it only reads.
Which files are indexed
| File | Indexed |
|---|---|
.md, .markdown, .mdx | yes, cut at headings |
.txt, .text | yes |
.pdf, Office files, pictures, anything else | no: named as skipped |
| a file over 8 MiB | no |
a file whose name starts with . | no |
PDFs are not read: extracting text from them needs a reader nocturn does not have. The index also holds at most 50,000 passages; a file that would pass it is refused and named, and the rest still works.
Set it up
Searching needs an embedding endpoint: NOCTURN_EMBED_BASE_URL, or OPENAI_BASE_URL when that is not set, with NOCTURN_EMBED_API_KEY, NOCTURN_EMBED_MODEL and NOCTURN_EMBED_DIMS (Configuration). With no endpoint at all the tool does not exist.
Indexing sends your documents out
Embedding a document sends its text to the configured endpoint, and so does every question. Point it at a provider you accept that for, or at one on your own network.
nocturn knowledge index # now, instead of within a minute
nocturn knowledge status # how many files and passages are indexed, and where
nocturn knowledge ls # the documents in the indexEach takes -w <workspace> (default main), before the other arguments. index names every file it skipped and every file it could not index, with the reason. When you change the embedding model or its length, delete knowledge.idx.json in the workspace's folder and run nocturn knowledge index again: the old vectors do not fit.
How it works
The index is the file knowledge.idx.json in the workspace's folder. A file whose size and time are unchanged is not even opened; one that was only touched is not embedded again.
Explore know
Related
- Configuration: knowledge
- Automations: an agent can list
knowledge_searchamong its tools