--- name: carrel-search description: "Query the user's local knowledge bases through the Carrel search API, use original text and source images as needed in the answer, list the reference files and offer follow-up directions drawn from the knowledge graph. Use when the user asks to search the knowledge base, find evidence in the stored material, compare records, or answer from several documents together." --- # Carrel-Search Evidence is retrieved through Carrel's search service (`app/kb_search`, default port 9810); the agent invoking this skill understands the question, composes the answer, lists the reference files and turns the graph leads into directions the user can ask about next. The service only recalls, reranks and arranges evidence and does no generation. The display name is **Carrel-Search** and the invocation name is `$carrel-search`. ## Invocation The client is `scripts/carrel_search.py` in this directory (Python 3.9+, standard library only). It defaults to `http://127.0.0.1:9810`; when the service runs on another machine, set the address and token through environment variables or a config file as described in [API and configuration](references/api.md). The skill contains no real token; never read or print one. `SKILL_DIR` stands for the directory containing this `SKILL.md`; replace it with the actual absolute path when executing. ```bash python3 "$SKILL_DIR/scripts/carrel_search.py" search --question "" ``` - **Every command prints a compact view directly**: retrieval status, the text of the sources (each with the file and place it comes from), facts, page summaries and graph leads, and at the end "Reference files", one line per file. Quality and degradation flags remain visible; IDs, scores and debug fields are left out; document text is not: a hit is printed in full and the chunks before and after it follow it. The script keeps the complete response by itself; do not pass `--output` and do not write scripts of your own to parse it. - **What does not fit goes to the next page; nothing is cut off**: one output has a size limit, and every page ends by saying what the next page is and how to fetch it (`show --page 2`). Where it says "read on", read every page before using the result: reading back the original and listings are always like this, and so is a search whose best sources are too long for the first page, which then says so. Where it says "the full text of the other sources, to be read when useful", the next page holds the lower-ranked sources and neighbouring chunks of a search and may be skipped. An entry too long for a page continues on the next one, which opens with the same label and "(continued from the previous page)". To save room, the path of a file is written in full only the first time and "same file as S1" afterwards, and a table header repeated from an earlier chunk reads "HEADER: same as S3". "chunk 26 of 67" at the end of a source line is its position in the document and the document's length in chunks. - **Every entry has a label**: S a source, F a fact, P a page, E an entity, R a relation, H the neighbourhood of a subject (`H1.2` is its second relation), N a relation returned by a neighbourhood lookup. Later commands point at an entry with `--ref :