# Neperi > Neperi Search finds the right passage through typos, missing accents, words written without spaces and OCR noise, in many languages, on plain CPUs: a search API for websites and RAG. Homepage: https://neperi.com Everything is JSON; errors include a `hint` telling you how to fix the request. ## Start - Get an API key in the console: sign up at https://app.neperi.com/app#signup (or sign in at https://app.neperi.com/app), then Account → My keys → Create a key; the key is shown once - Or sign up by API (an agent on its own): `POST https://app.neperi.com/v1/signup` body `{"email": "you@example.com"}` -> `api_key` (shown once) - Auth: header `Authorization: Bearer ` - MCP: `https://app.neperi.com/mcp` (streamable HTTP) with the same header - List your tools: `GET /v1/tools` (formats: anthropic, openai, mcp) - Call a tool: `POST /v1/tools/` with the tool input as JSON body - Usage and limits: `GET /v1/usage` ## What you can use - Audit log (`audit`): Append-only audit log of administrative events; operator and tenant views. Tools: audit_events. - Neperi Search (`neperi`): Collections of text, or of the rows of an Excel / CSV file (one file a collection), searched by the Neperi engine through typos, missing accents, OCR noise and glued words, in many languages; kept in memory by a node service. Tools: neperi_collections_search, neperi_collections_stats, neperi_collections_get, neperi_collections_create, neperi_collections_update, neperi_collections_delete, neperi_search, neperi_upsert, neperi_delete, neperi_status, neperi_get, neperi_update, neperi_categories, neperi_fields, neperi_move, neperi_items_bulk, neperi_categories_rename, neperi_categories_delete. ## Neperi Search API Search text that people type with typos, without accents, with words glued together, or that came out of OCR, in many languages. JSON in, JSON out. Base URL: `https://app.neperi.com`. Every call carries `Authorization: Bearer `. ### Data model A **collection** is a named set of **items** searched together: passages of text, or the rows of one Excel / CSV file (see «Excel and CSV files» below). The console calls collections **Data stores**. Names: 1–64 characters, lowercase letters, digits, `_`, `.`, `-`, starting with a letter. An **item** is one passage, or one row of a table, with an `id`. The console calls items **Records**. Split long documents into passages of a few hundred words, one item per passage, with the document in the id (`handbook.pdf:4`) so that `id_prefix` deletes them together. Besides its `text`, an item can carry a `title` (searched too), `tags` (other words it is found by -- searched too, and a filter), one `category`, a `created_at` date and `metadata` (any JSON, given back with results). A search is in one **collection** -- what is searched together (a product's help, one file) -- and is narrowed in the same call by: - **category**: one group per text item (`"Booking & payment"`); each collection has its own categories -- a table (an Excel / CSV file) has none: its columns do that; - **dates**: when items were created (`created_at`) or last changed (`updated_at`); - **filter fields**: a collection's own fields, read from a metadata key or a column of a table -- a list of values (a brand, a city), a number (a price), yes / no (in stock), a date (a release day); - **tags**: the items carrying every tag named (`["audio", "warranty"]`), wherever it stands in their list, as written. The console's Records page works the same way: pick a data store, then its category, its fields and the days. ### Quick start 1. Get an API key: sign up at https://app.neperi.com/app#signup (Google, or email and password); signing up makes the account only. Then, signed in to the console, open **Account → My keys → Create a key**: the key (`abk2_…`) is shown once, so copy it. An AI agent working on its own can instead call `POST https://app.neperi.com/v1/signup` with `{"email": "you@example.com"}`: the answer has `api_key`, shown once. 2. Add documents (the collection is made if missing): ``` curl -X PUT https://app.neperi.com/v1/neperi/collections/handbook/items \ -H "Authorization: Bearer $NEPERI_API_KEY" -H "Content-Type: application/json" \ -d '{"items": [{"id": "tuition", "title": "Tuition", "text": "The IELTS 6.5+ course costs $480 for 48 lessons, books included.", "metadata": {"doc": "handbook.pdf", "page": 4}}]}' ``` ``` {"collection": "handbook", "upserted": 1, "gen": 1, "service": "not_loaded", "ids": ["tuition"]} ``` 3. Search, typos and all: ``` curl https://app.neperi.com/v1/neperi/collections/handbook/search \ -H "Authorization: Bearer $NEPERI_API_KEY" -H "Content-Type: application/json" \ -d '{"query": "how much does the ilets cours cost", "top_k": 3}' ``` ``` {"collection": "handbook", "query": "how much does the ilets cours cost", "total": 1, "results": [{"rank": 1, "id": "tuition", "score": 86.0, "snippet": "The IELTS 6.5+ course costs $480 for 48 lessons, books included.", "highlights": [[4, 9], [15, 21], [22, 27]], "title_highlights": [], "fuzzy": {"ielts": "ilets", "course": "cours", "costs": "cost"}, "metadata": {"doc": "handbook.pdf", "page": 4}, "title": "Tuition", "category": null, "rev": 1, "created_at": "2026-11-17T03:13:44+00:00", "updated_at": "2026-11-17T03:13:44+00:00"}], "took_ms": 0.5, "offsets": "utf16", "candidates": null, "loaded": true, "terms": ["how", "much", "does", "the", "ilets", "cours", "cost"]} ``` 4. Delete: ``` curl https://app.neperi.com/v1/neperi/collections/handbook/items/delete \ -H "Authorization: Bearer $NEPERI_API_KEY" -H "Content-Type: application/json" \ -d '{"ids": ["tuition"]}' ``` ``` {"collection": "handbook", "deleted": 1, "gen": 2, "service": "pushed"} ``` ### Filters Narrow a search in the same call: `category` (or a list of them), the days items were created or changed (`created_from` / `created_to`, `updated_from` / `updated_to`: `"2026-07-01"`, both included), the collection's filter fields (`fields`) and tags (`tags`: the items carrying all of them): ``` curl https://app.neperi.com/v1/neperi/collections/products/search \ -H "Authorization: Bearer $NEPERI_API_KEY" -H "Content-Type: application/json" \ -d '{"query": "waterproof backpack", "category": "Backpacks", "fields": {"price_usd": {"to": 150}, "in_stock": true}}' ``` `GET https://app.neperi.com/v1/neperi/fields?collection=products&values=1` lists a collection's filter fields: `key`, `type` (`list`, `number`, `bool`, `date`) and the values its items have. Fields are declared in the console (Records → ⚙ Filter fields), from a metadata key or a column of a table; importing an Excel / CSV file there offers its columns. The conditions of each type: «Filter fields» in https://app.neperi.com/llms-full.txt. ### Excel and CSV files **One file is one collection.** Import a spreadsheet and each row becomes an item, searched cell by cell: a typo in a name still finds the customer, and each result says which cells matched. Name the collection after the file (`customers.xlsx` → `customers`): an import makes a new collection. When the file changes, import it again into the same collection with `override=yes` (without it, a collection that has rows is refused: 409 `collection_exists`). ``` curl -X POST https://app.neperi.com/v1/neperi/collections/customers/import \ -H "Authorization: Bearer $NEPERI_API_KEY" -F file=@customers.xlsx ``` Search it with the same `…/search` call: each result has the row's `cells` and `cell_highlights` (the matches, cell by cell); a column such as a brand, a price or a date can be a filter field. `.xlsx` or `.csv`, the first row names the columns, up to 10 MB a file. Options, limits and updating a file: «Tables» in the whole reference, https://app.neperi.com/llms-full.txt. Reading results: `rank` is the order (1 = best). A **lower `score` is a closer match**; compare scores within one answer only. A reranker sets the final order (see «How results are ranked» in https://app.neperi.com/llms-full.txt); `score` then belongs to the place in that order, so the scores rise down the list even where an item was moved up. `match_score` is the item's own match score (lower = closer), and `reranked: true` marks a result the reranker put above a result of the same answer whose `match_score` is closer -- the console's **R** (within the answer: ask more results to see more). `highlights` are `[start, end)` ranges in the item's `text`, counted in UTF-16 code units (`"offsets": "utf16"`, as JavaScript strings count), so `text.slice(start, end)` is the matched word -- the matched words of every passage found, not only the best one, and every other place the same word stands (a word typed, or a word matched approximately in that item). `title_highlights` shows the matches in the title, `tag_matches` the tags that matched. `fuzzy` names the words matched approximately (a typo, OCR noise, part of a word -- a longer word that starts with the one typed, `battery` for `bat`, is marked whole; another form of the word, `hours` for `hour`; a digit written above or below the line, `m²` for `m2`): the word as found, lowercase without accents → the word of the query; any other match is the word typed, case and accents aside -- the letters typed found as typed inside a longer word too (`345` in «L12345», `ire` in «repaired»: those letters alone), a letter, a digit or a symbol typed on its own (`7`, `$`) wherever it stands -- one stuck to a word typed glued (`+` of `+84`) only where it stands next to that word. A code or a number written with the characters that part it (`C-4`, `14.90`, `SP-01234`) is marked as one range: the word typed when it is that code (`c4`, `1490`, `14,90`), a similar word when the word typed is its beginning (`14.9` for «14.90»). To mark them apart, look a marked word up there (lowercased, accents removed). `letter_match: true`: no word of the item resembles a word of the query -- the search matched the typed letters close together and in order inside other words (`holiday` against «validity»); its highlights then mark those letters. The console colours two kinds of match: the letters as typed (a highlight whose word is not in `fuzzy`, and the letters of a letter match) and a similar word (in `fuzzy`). To mark the snippet of a result list (a search box), use `snippet_highlights`: the same ranges, counted in `snippet` (`snippet.slice(start, end)`), so the whole `text` is not needed. An agent that reads rather than draws gets the matched words as text in `matched`, each once, an approximate one as `found ≈ typed`: `["IELTS ≈ ilets", "course"]`. In Python, slice UTF-16 offsets with `s.encode("utf-16-le")[2 * start:2 * end].decode("utf-16-le")`. Stopwords: the words almost every text has -- `the`, `of`, `and`, `between`, `about`… (a list for each language) -- are left out of the index and of the query, so they never decide a match and are not marked. A question works: its other words are searched. A query made only of stopwords (`between`) cannot find them -- what comes back are letter matches. Search with the words that carry the meaning. A stopword is left out wherever it stands, the last word too: a word still being typed (`nor` of `Norvik`) counts from the letter that makes it another word (`norv`). Every query is read the same way -- a question, a sentence, keywords or only their first letters: up to three letters typed find the word they begin (`lo ma` finds «loading machine», `pe ea` «Pellora earbuds»). A letter or a digit typed on its own is a word of the query too (`7 14`, `iphone 7`, `2 to 4`): it matches where it stands alone (`7` in «7 to 14», not in «17»), at the start of a longer word only weakly (`4` finds «40» after «4»). A one-letter stopword (`a`, `I` in English) is left out as any stopword, yet counts where it stands right next to a word typed with it (`vitamin d` finds and marks «Vitamin D»). Codes and numbers: typed without the characters that part them, or with others, they find what the records write -- `sp01234` finds «SP-01234» and «SP 01234», `c4` finds «C-4», `0912345678` finds «0912 345 678» and «0912.345.678», `14,90` finds «14.90». What parts them: ONE of `space - – _ . , / \ : + # ·` between two of their letters or digits (a comma only between two digits; a non-breaking space is a space) -- `2l` finds «2 L», not «2 - L». A number of fewer than 6 digits skips only a decimal or thousands mark or a space between two digits (`69` finds «6.90», `25` «2,5», `84912` «+84 912 345 678», `1290` «1 290 ₽»; not «6-9»); a number typed with its mark keeps it in place (`2.5` finds «2,5», not «25»). The way the records write it comes first. A symbol -- `$ € £ ₫ % # & @ + °`… -- typed on its own (`free $`) is a word of the query; stuck to a number or a word, it belongs to that word: it counts where it stands right next to it, on either side (`19$` finds «$19», `+84` «+84 912 345 678» but not every «+», `25°c` «25 °C», `c++` «C++»). So does a lone letter or digit the search cuts off a word typed glued (`30l` finds «30 L», not every «L»). Punctuation (`. , ? ! : ;`, brackets, dashes) is not a word. A digit written above or below the line is that digit with a mark: `m2` finds «m²», `h2o` «H₂O», `h2so4` «H₂SO₄» -- after the same text written plainly (`a2` ranks «A2» above «a²»); typed as `m²`, «m²» comes first. How Neperi finds and ranks -- every way of searching (typos, accents, glued words, word forms, Chinese, Japanese, Korean and Thai, pinyin, OCR noise, tables), the ranking signals and the limits: «How Neperi searches» in https://app.neperi.com/llms-full.txt. Many queries at once -- to test Neperi against another engine on your own data: `POST https://app.neperi.com/v1/neperi/collections/{name}/search/batch` with `{"queries": ["…", "…"], "top_k": 10}` (up to 32; the other fields of a search the same for every query), one answer a query, each with the engine's own `took_ms`; how to compare fairly: «Evaluating Neperi» in https://app.neperi.com/llms-full.txt. For AI agents: the same operations are tools over MCP at `https://app.neperi.com/mcp` (streamable HTTP, same `Authorization` header): `neperi_search` (one collection, with its filters), `neperi_fields`, `neperi_categories`, `neperi_upsert`, `neperi_delete`, `neperi_get`, `neperi_update`, `neperi_status` and more; `GET https://app.neperi.com/v1/tools` lists them with their JSON schemas (formats: anthropic, openai, mcp). ### How Neperi searches Neperi matches words character by character instead of comparing exact tokens. Nothing to set up -- no analyzer, stemmer or dictionary to choose: one engine for every script and for collections that mix languages, on plain CPUs (no GPU, no embeddings). All of the following is on by default. **Ways a word is found** - Typos: a letter missing, extra, swapped or wrong (`recieve` finds «receive»); a query word the collection does not have is also read as its closest word there when that word is clearly the closest -- a short word needs a clear lead (`seond` is as near «send» as «seconds»: both count, and the words around it decide). - Accents and diacritics can be left out (`hoc phi` finds «học phí», `cafe` finds «café»); typed, they make the match sharper. - Letter forms are folded: Traditional and Simplified Chinese, full-width and ASCII characters, Arabic letter variants (أ إ آ → ا, ى → ي, ة → ه). - Glued words, in the query (`eiffeltower`, even `eifeltower`; Vietnamese syllables `hocky`; letters and digits `lop12a`) or in the documents (`data base` finds «database»). - Word forms: another ending still matches (`refund` finds «refunds», «refunded»), an English word and its plural or other form as the same word (`hour` / «hours», `box` / «boxes»), a little below the form typed; German, French, Spanish, Portuguese, Italian, Dutch, Russian, Ukrainian, Polish, Czech, Turkish, Indonesian, Arabic, Persian and Hindi words also match by their stem. - Hyphens and apostrophes: `Amazonas-Regenwald` searches both words, `dell'hotel` both parts; codes keep their digits (`COVID-19`, `SR-2024-001`), and a number must match too (`month 1` ranks «month 1» above «month 8»). - Languages written without spaces: a Chinese or Japanese query is cut into words by the collection's own statistics, a Thai one with a dictionary; Korean drops particles and splits glued words; a same-sounding wrong character from a Chinese or Japanese input method is set right; a word that changes script (`用Python写`) is split there. - Chinese typed as pinyin: a query of pinyin syllables finds the Chinese text of a collection -- spaced, syllable by syllable or glued (`beijing daxue`, `bei jing da xue`, `beijingdaxue`), even with a wrong letter in a syllable. - Noisy documents (OCR of scans and photos): a garbled word still matches, and a word of the document that is no real word of its language is taken for OCR noise, so a close match on it counts as an exact one. - Tables (Excel / CSV): each cell is matched on its own -- a phrase does not run across two cells -- and the answer says which cells matched (see «Tables»). - Codes, numbers and symbols: written with other separators (`c4` finds «C-4»), a symbol on the other side (`19$` finds «$19»), a digit above or below the line (`m2` finds «m²») -- see «Codes and numbers». - Titles are searched with the text. **How results are ranked** (a lower `score` is a closer match) - Coverage: how many of the query's words the item holds -- in its best passage first, then elsewhere in the item, more when near it. - Proximity and order: words close together count more, and more again side by side in the query's order. - Rarity: a word rare in the collection and in its language weighs more -- a name or a code a lot, a common word little, also in a small collection (built-in word frequencies for each language; a collection that mixes languages uses each one's own). - Exactness: an exact word beats an approximate one, a whole word beats the start of a longer one. - A heading line: in a passage that starts with a short line in square brackets (`[Handbook › Fees]`, then a new line), the words found on that line count more -- give each passage of a long document its heading that way. - Stopwords are left out (see «Stopwords»); a long question keeps its most telling words. - The reranker: the engine's first 50 candidates are put in order again by a ranking model trained on many search questions in many languages, which weighs the signals above together, with BM25 statistics of the words and the length of the passage. An item can so rank above one whose own match is a little closer: its `match_score` is then higher than that of a result below it, and it comes with `reranked: true` (the console's Records page marks it **R**). `score` belongs to the place in the final order (the candidates' scores handed out by rank). Large collections are searched through a candidate index, so search time grows slowly with their size. A collection not searched for a while is loaded again by the next search (`"loaded": true`, slower). **Limits.** Neperi matches words, not meanings: a synonym or a paraphrase that shares no word with the passage is not found, and a query in another language than the documents finds only what both share (names, codes). Search in the documents' language, with the words they would use; for meaning-level retrieval in RAG, use Neperi next to a vector search. Benchmarks against the best BM25 setups: https://neperi.com/#bench. **Tips for agents.** Send the user's words as they are: no need to fix spelling, add accents or split glued words -- the engine does. Keywords, a name, a code or a whole question all work. Translate only into the documents' language. Read `matched` to see why an item came back (and what the engine took a typo for). Compare scores within one answer only, and show `letter_match` results apart. ### Evaluating Neperi To compare Neperi with another engine on your own documents and questions: 1. Add the same passages to a collection (`PUT …/items`, up to 2,000 a call), with the ids your gold answers name. Split long documents into passages as for any search. 2. Run one query first: the first search of a collection loads it (`"loaded": true`) and is slower -- leave it out of the timings. 3. Send the queries as people type them: no spelling fixed, no accents added or taken off, no stopwords removed -- the engine does that, and a cleaned query hides what it does. Ask in the language of the documents. 4. Quality: send the queries in batches (`POST …/collections/{name}/search/batch`, 32 at a time) with the `top_k` your measure needs, and score each answer's ids against the gold ones (top 1, recall@k, MRR). 5. Speed: an answer's `took_ms` is the engine's own time for that query -- the figure to set beside an engine running on your machine; a single `…/search` call measures what a user waits, the network included. 6. Each query of a batch counts as one request of the plan's requests a minute: on 429 wait `Retry-After` seconds and send the batch again. Tokens are those of separate searches; a smaller `top_k` or `snippet_chars` costs less. ### Items `PUT /v1/neperi/collections/{name}/items` adds or replaces items; the collection is made if missing. Body `{"items": [...]}`, up to 2,000 items a call. Each item: - `text` (required, up to 20,000 characters); a row of a table has `cells` instead (see Tables) - `id` (up to 256 characters; left out, the id is made from the text, so the same text twice is stored once) - `title` (up to 300 characters, searched too), `category` (up to 100 characters), `metadata` (any JSON object, given back with results), `created_at` (ISO 8601, e.g. `"2026-07-18"`: the date of the document itself -- a contract, an article, a meeting -- which a search filters by with `created_from` / `created_to`; left out, the time the item is first written, kept when it is written again) - `tags` (up to 20, each up to 64 characters): other words the item is found by -- other names, synonyms, words its text does not have (`["headphones", "airpods"]` on a passage about earbuds). They are searched with the text, and a search can keep only the items carrying some (`tags`); the ones a search matched come back in `tag_matches`. They count with the item's characters, as the title does. - `rev`: write only if the item is still at that revision (0 = it must not exist yet); otherwise the whole batch is refused with 409 `item_changed` Answer: `{"collection", "upserted", "gen", "service", "ids"}` (`ids` when 100 items or fewer). `gen` counts the collection's changes. `service` tells whether the in-memory copy got the change now (`pushed`) or will load it at the next search (`not_loaded`, `stale`): the data is saved either way. `GET /v1/neperi/collections/{name}/items?limit=50&after=` lists items in id order (`limit` up to 500), each with a 200-character `preview`; go on with `after` = the `next_after` of the answer (null at the end). `GET /v1/neperi/collections/{name}/items/{id}` gives one item whole: `{"item": {"id", "text", "metadata", "title", "tags", "category", "created_at", "updated_at", "rev", "chars"}}`. `GET /v1/neperi/collections/{name}/tags` lists the collection's tags, most used first -- what a tag box suggests as it is typed in: `{"tags": [{"tag", "count"}], "tree", "categories"}`. `tree` links the tags the way items carry them, in order (`{"tag": "audio", "count": 4, "children": [{"tag": "earbuds", …}]}`); `?limit=` caps both (300 by default); `&category=` counts them among that category's items only. `POST /v1/neperi/collections/{name}/items/get` with `{"ids": [...]}` (up to 100) gives them whole, plus `missing`: the ids not found. `PATCH /v1/neperi/collections/{name}/items/{id}` changes part of an item: `text`, `title`, `category` (null removes it), `tags` (replaces them) or `add_tags` / `remove_tags`, `metadata` (merged; a key set to null is removed), `created_at`, `rev` (only if still at that revision). Example: `{"category": "Fees", "metadata": {"page": 5}}`. `POST /v1/neperi/collections/{name}/items/delete` with `{"ids": [...]}` (up to 5,000) or `{"id_prefix": "doc42:"}` (every item whose id starts with it): `{"collection", "deleted", "gen", "service"}`. `POST /v1/neperi/collections/{name}/items/move` with `{"ids": [...], "to": "other"}` moves items as they are to another collection (made if missing); an id the target already has stops it with 409 `id_taken`. ### Search `POST /v1/neperi/collections/{name}/search` -- a search is in one collection. Body: - `query` (required, up to 1,000 characters): as people type it -- keywords or their first letters, a question, a name, a code; letters, digits and symbols typed on their own count as words; stopwords (`the`, `between`…) are left out (see «Stopwords» above) - `top_k`: results wanted, 1–100 (default 10) - `category`: only the items of this category, or of any of a list (`["Shoes", "Bags"]`) - `created_from` / `created_to`, `updated_from` / `updated_to`: days (`"2026-07-01"`), both included -- when items were created (`created_at`: send the document's own date there when you add it) or last changed - `fields`: the collection's filter fields, `{"key": condition}`; all of them must hold (see «Filter fields») - `tags`: only the items carrying every one of these tags, as written (`["audio", "warranty"]`) - `snippet_chars`: snippet length, 0–2,000 (default 240) - `include_text`: true to get each item's whole `text` too (counted in output tokens) - `all_terms`: true for items matching every term of the query only - `columns`: a table only: the rows matched in these columns (see Tables) - `level`: advanced engine setting, 1–4 (default 3); leave it out Answer: `{"collection", "query", "total", "results": [...], "took_ms", "offsets": "utf16", "terms", "candidates", "loaded"}`; each result `{"rank", "id", "score", "match_score", "reranked", "snippet", "snippet_highlights", "highlights", "title_highlights", "tag_matches", "fuzzy", "letter_match", "matched", "metadata", "title", "tags", "category", "created_at", "updated_at", "rev"}` (+ `text` with `include_text`). `loaded` is true when the collection had to be loaded into memory first: the first search after a while is slower. With filters, the results are only items passing them and `total` counts the matches among those; `total_exact` is false when a broad filter on a large collection left matches unlooked at. Example, what mentions refunds in the «Changes & refunds» category, reviewed since September: `{"query": "refund", "category": "Changes & refunds", "fields": {"reviewed": {"from": "2026-09-01"}}}`. `POST /v1/neperi/collections/{name}/search/batch` searches several queries in one collection at once: `queries` (1–32, each up to 1,000 characters) instead of `query`, the rest of the body as above -- the filters apply to every query. Answer: `{"collection", "answers": [...], "took_ms", "offsets": "utf16", "loaded"}`; one answer a query, in their order: `{"query", "total", "results", "took_ms", "terms", "candidates"}`, each result as in a search. Each query is a search of its own: the same results, the same tokens, and **one request of the plan's requests a minute** -- a batch that does not fit in the minute is refused whole (429, `Retry-After`). `took_ms` of an answer is the engine's time for that query, without the network. Batches run one at a time: when another one is running, 503 `batch_busy` (retry after `Retry-After`). ### Filter fields A collection's filter fields narrow its searches by what its items carry. `GET /v1/neperi/fields?collection={name}&values=1` lists them: `{"fields": [{"key", "label", "type", "column", "values": [{"value", "count"}], "min", "max"}]}` -- a field reads its values from the metadata key `key` of the items, or from the column `column` of a table. Add `&category={category}` for the fields that category's items carry, with the values, counts and range of those items only -- filters that follow the category picked, as the console's Records page does. In a search's `fields`, by `type`: - `list`: a value, or a list of values (any of them): `{"brand": ["Norvik", "Altamo"]}` - `number`: `{"from": 50, "to": 150}`, both included, either one left out: `{"price_usd": {"to": 150}}`; values written `1.200.000 đ` or `$1,200` count as numbers - `bool`: `true` or `false` (the data may say yes / no, true / false, 1 / 0): `{"in_stock": true}` - `date`: days, `{"from": "2026-12-01", "to": "2026-12-31"}`; the data may hold `2026-12-01`, `01/12/2026` or an Excel date; `min` / `max` are the first and last day A key the collection has no field for is refused (422 `unknown_field`); a range that is not a number or a day, 422 `invalid_range`. Fields are declared in the console -- Records → ⚙ Filter fields, which suggests a type from the values -- or when an Excel / CSV file is imported there (its columns are offered). ### Tables (Excel / CSV) A collection can hold the rows of a sheet instead of text: one item a row, its cells kept apart and searched cell by cell (a phrase never spans two cells, the order of the columns does not count), so `jonh smith brooklin` finds the customer whose name and city match, and each result says which cells matched. A collection holds text items or rows, not both. **One file, one collection** -- how to organise spreadsheets: - Give each file a collection of its own, named after it (`customers.xlsx` → `customers`, `price_list.csv` → `price_list`). A workbook with several sheets: one collection per sheet (`sheet=` on each import). - A new version of the file: import it again into the same collection with `override=yes`. The collection becomes the file again (rows it no longer has are deleted) and the rows that stay keep their title and metadata. - Do not import two different files into one collection: `override=yes` would delete the rows of the first. To add or change rows one by one, write them with `PUT …/items` and `cells`. - Each collection is searched on its own. A column worth filtering by -- a brand, a price, a date, a type -- becomes a filter field (see «Filter fields»). A table has no category: what would be one is a column. - If the sheet has a column with a stable code (customer number, SKU), pass it as `id_column`: a row then keeps its id, and what was put on it, however the sheet is sorted or edited. - A text document (PDF, Word, a web page) is not a table: split it into passages and `PUT` them as text items, in a collection of its own. - Over MCP, rows are written with `neperi_upsert` and `cells`; a file goes through the REST import below. `POST /v1/neperi/collections/{name}/import` takes the file as multipart form data (field `file`, `.xlsx` or `.csv`), or CSV text with `Content-Type: text/csv`. The first row names the columns; every other row with something in it is a row of the table. Options, as form fields or in the query: `override` (`yes`: the collection, which has rows, becomes the sheet -- rows it no longer has are deleted; without it the import makes a new collection), `sheet` (a workbook's sheet; the first by default), `id_column` (the column holding each row's id; by default `row-`, n the row number in the sheet) and `search_columns` (repeat it for each column searched; all by default). One collection is meant for one sheet. An import writes the cells: what a row the table already has carries otherwise -- its title, metadata -- stays when the sheet is imported again. The same row is found by its id; without an `id_column` the ids are row numbers, which move when a row is inserted or the sheet sorted, so it is found by its content: the row of the new file with the same cells, in the columns both have (a column added or dropped does not matter); a row whose cells changed (a new price), by a key column -- the first column whose values are all filled and all different, in the file and in the table (a SKU, a code, often a name); without one it starts afresh. ``` curl -X POST https://app.neperi.com/v1/neperi/collections/customers/import \ -H "Authorization: Bearer $NEPERI_API_KEY" -F file=@customers.csv ``` ``` {"collection": "customers", "kind": "table", "format": "csv", "file": "customers.csv", "sheet": null, "columns": ["Name", "Address", "Email"], "search_columns": ["Name", "Address", "Email"], "id_column": null, "replaced": false, "rows": 4, "upserted": 4, "deleted": 0, "skipped": 0, "skipped_rows": [], "cut_cells": 0, "duplicate_ids": 0, "gen": 1, "service": "reload"} ``` The search is the same call. A row comes back with its `cells` and the matches by cell, `cell_highlights` (`[start, end)` in that cell's value, UTF-16); its `snippet` is the row as one line: ``` curl https://app.neperi.com/v1/neperi/collections/customers/search -H "Authorization: Bearer $NEPERI_API_KEY" \ -H "Content-Type: application/json" -d '{"query": "jonh smith brooklin", "top_k": 3}' ``` ``` {"collection": "customers", "query": "jonh smith brooklin", "total": 4, "columns": ["Name", "Address", "Email"], "results": [{"rank": 1, "id": "row-2", "score": 2.1485, "snippet": "John Smith · 214 Bedford Ave, Brooklyn, NY 11211 · john.smith@acmecorp.com", "cells": {"Name": "John Smith", "Address": "214 Bedford Ave, Brooklyn, NY 11211", "Email": "john.smith@acmecorp.com"}, "cell_highlights": {"Name": [[0, 4], [5, 10]], "Address": [[17, 25]], "Email": [[0, 4], [5, 10]]}, "highlights": [], "metadata": {"row": 2, "file": "customers.csv"}, "rev": 1, ...}, ...]} ``` `"columns": ["Name"]` in the search body keeps only the rows matched in those columns (`total` counts before it). Rows can be written without a file too: `PUT /v1/neperi/collections/{name}/items` with `cells` instead of `text`, e.g. `{"items": [{"id": "c-90", "cells": {"Name": "Peter Nguyen", "City": "Brooklyn"}}]}` (a column the table does not have yet is added at the end; one a row leaves out is empty). `PATCH /v1/neperi/collections/{name}/items/{id}` with `{"cells": {"Email": "p.nguyen@example.com"}}` changes cells (null empties one). Reading an item of a table gives its `cells`, and as `text` the row as one line. A row's `created_at` is when it was first imported (kept on the next imports); rows written with `PUT …/items` can send their own. Limits of an import: 10 MB a file, 50 columns, 2,000 characters a cell (longer: cut, counted in `cut_cells`); a table holds up to 200,000 rows. A bigger file: split it into several collections. A CSV is UTF-8 (Excel: Save As, «CSV UTF-8»); an old `.xls` is saved as `.xlsx` first. Errors: 413 `file_too_large`, `too_many_rows`, `table_too_large`; 409 `collection_exists`, `collection_is_text`, `collection_is_table`; 422 `csv_encoding`, `too_many_columns`, `unknown_column`, `no_rows`, `import_option_removed` (`category` or `tags` sent); 404 `sheet_not_found`. ### Collections `GET /v1/neperi/collections` lists them: `{"items": [{"id", "name", "title", "items", "chars", "units", "gen", "created_at", "updated_at"}], "total", "limit", "offset"}`. A collection is made by its first `PUT …/items`; `POST /v1/neperi/collections` with `{"name": "handbook", "title": "Student handbook"}` makes an empty one. `GET /v1/neperi/collections/{name}/status` gives its size and its in-memory copy (`service.state`: `ready`, ...). `DELETE /v1/neperi/collections/{name}` deletes it with all its items: `{"deleted": "handbook"}`. `GET /v1/neperi/status` gives the account's totals against the plan: `{"collections", "collections_limit", "items", "units", "units_limit", "used_pct", ...}` (units = stored tokens). ### Categories **Category**: one per text item (`category`, up to 100 characters). Use it for the main grouping: a section of a help centre, a kind of document. Each collection has its own categories: `GET /v1/neperi/categories?collection=handbook` lists those of one collection with their counts (without `collection`: every category of the account, with the collections using it). A search narrows to one category, or to several, with `category` (see «Search»). A category exists while an item has it; a collection can also declare its categories ahead, so that forms offer them before an item has one: `PUT /v1/neperi/collections/{name}/categories` with `{"categories": ["Fees", "Schedules"]}` (in their order, up to 200). They are listed first, `"declared": true`, with 0 items until one has them; renaming or taking off a category (below) updates the list. The rows of a table have none (422 `table_rows_have_no_category`): a column of the file and a filter field from it do that. Which one to use: a grouping that every item has → category; text searched together and kept apart from the rest → a collection. Changes to many items run in batches, one at a time per account: `POST /v1/neperi/categories/rename` (`{"from", "to"}`; into a category already used, the two merge), `POST /v1/neperi/categories/delete` (`{"category"}`) -- both with `collection` for one collection only -- and `POST /v1/neperi/items/bulk` (one action on every item of a filtered view, `where` = `collection` and the filters of a search: `category`, the days, `fields`; or on the items you name: `"ids": [...]` (up to 1,000) with `"where": {"collection": "handbook"}`; actions `set_category` (null takes it off), `add_tags` / `remove_tags` (`tags`), `rename_tag` (`from_tag` → `to_tag`, where it stands on the items that carry it; into a tag an item has already, the two become one), `move`, `delete` -- the rows of a table are only deleted: 422 `table_rows_delete_only`). Call again with the returned `op` until `done`; `dry_run: true` only counts. `GET /v1/neperi/ops/current` shows the running one, `POST /v1/neperi/ops/{op_id}/stop` stops it (what it changed stays changed). ### Tokens, limits and errors A token is about 4 characters, counted on what you send (a document once when you add it, each query) and on what you get back (each result's snippet, about 240 characters: a search of 10 results is about 600 tokens however long the documents are; `include_text` counts the whole text). `GET https://app.neperi.com/v1/usage` shows the month's tokens, the plan's limits and the requests a minute; `GET /v1/neperi/status` the tokens stored. Every API call is one request of the plan's requests a minute, and each query of a batch search one more. Limits: 2,000 items per `PUT`, 20,000 characters per item, 100 collections per account, 32 queries per batch search, 100 results per search. Errors are JSON: `{"error": {"code", "message", "hint"}, "request_id"}`; the `hint` says how to fix the request. Common codes: 401 `unauthorized` / `invalid_api_key`; 402 `quota_exceeded` (tokens of the month) / `neperi_quota_exceeded` (stored tokens of the plan); 403 `insufficient_scope` (a read-only key writing); 404 `collection_not_found` / `item_not_found`; 409 `item_changed` / `id_taken` / `too_many_collections` / `bulk_op_running`; 422 `invalid_arguments` (the request body against its schema, which `details` includes); 429 `rate_limited`; 503 `neperi_unavailable` / `collection_loading` / `batch_busy` (retry after the `Retry-After` seconds; your data is safe). ## Reference - Machine-readable manifest: https://app.neperi.com/v1/manifest