$npx -y skills add zilliztech/mfs --skill deep-researchAnswer a broad, open-ended, or multi-part question by iteratively searching MFS-indexed sources, following up on gaps, and synthesizing a cited report — the same "reason and search over private data" job zilliztech/deep-searcher does, but as a skill on top of mfs-find instead o
| 1 | # Deep research over MFS-indexed sources |
| 2 | |
| 3 | ## 1. What this is (and what it replaces) |
| 4 | |
| 5 | [deep-searcher](https://github.com/zilliztech/deep-searcher) is an |
| 6 | open-source framework that reasons over private data: it decomposes a |
| 7 | question, iteratively searches a vector database, evaluates whether the |
| 8 | evidence is sufficient, and synthesizes a cited report. Built before |
| 9 | agentic coding tools existed, it had to hand-roll every piece itself — |
| 10 | document loaders, a multi-provider LLM/embedding/vector-DB matrix, and a |
| 11 | custom iterative-retrieval orchestration loop in Python. |
| 12 | |
| 13 | None of that orchestration is needed anymore. MFS already does ingestion + |
| 14 | hybrid search over many source types, and an agent's own reasoning loop |
| 15 | already does "search, judge, follow up, repeat" natively once it has a |
| 16 | search tool. This skill is that missing piece: not new retrieval code, just |
| 17 | the **strategy** for running deep-searcher's decompose → search → evaluate |
| 18 | → synthesize loop through `mfs search` / `mfs cat`. |
| 19 | |
| 20 | This skill assumes `mfs-find` for the actual command mechanics (search |
| 21 | modes, locators, `--peek`/`--skim`, index-status diagnosis). Read that |
| 22 | skill for those details — this one only adds the multi-round strategy on |
| 23 | top. |
| 24 | |
| 25 | ## 2. Precondition: sources must be indexed |
| 26 | |
| 27 | Same as `mfs-find`: `mfs status` / `mfs connector inspect <uri>` first. If |
| 28 | nothing relevant is indexed yet, **redirect to `mfs-ingest`** — don't run a |
| 29 | research loop against an empty index. |
| 30 | |
| 31 | ## 3. The loop |
| 32 | |
| 33 | ``` |
| 34 | decompose search rounds evaluate synthesize |
| 35 | ┌───────────┐ ┌───────────────────────┐ ┌──────────────────┐ ┌───────────┐ |
| 36 | │ 2-4 angles│ → │ mfs search per angle, │ → │ enough coverage? │ → │ cited │ |
| 37 | │ on the Q │ │ semantic + keyword │ │ gaps → new angles│ │ report │ |
| 38 | └───────────┘ └───────────────────────┘ └──────┬───────────┘ └───────────┘ |
| 39 | ▲ │ not enough |
| 40 | └────────────────────────────┘ (max ~4 rounds) |
| 41 | ``` |
| 42 | |
| 43 | 1. **Decompose.** Break the question into 2-4 concrete angles before |
| 44 | searching anything. "Write a report on our rate-limiting story" becomes: |
| 45 | *current implementation*, *past incidents/bugs*, *design |
| 46 | discussion/rationale*, *config knobs*. A single search for the raw |
| 47 | question under-recalls on anything but the narrowest asks. |
| 48 | |
| 49 | 2. **Search each angle**, scope per `mfs-find` §6-7 (hybrid by default, |
| 50 | `--all` for genuinely cross-source asks, scoped to 2-3 likely sources |
| 51 | otherwise): |
| 52 | ```bash |
| 53 | mfs search "<angle 1>" <scope> --top-k 15 |
| 54 | mfs search "<angle 2>" <scope> --top-k 15 |
| 55 | ... |
| 56 | ``` |
| 57 | Track **distinct objects** found (dedupe by `source`), not raw hit |
| 58 | count — five chunks from one file is one citation, not five. |
| 59 | |
| 60 | 3. **Evaluate coverage before reading everything.** For each angle: is |
| 61 | there at least one strong hit? For the question as a whole: do the |
| 62 | found objects, read together, actually answer it, or do they only |
| 63 | establish that the topic exists? Common gaps: an angle returned nothing |
| 64 | (rephrase it, don't drop it silently), all hits are from one source |
| 65 | type when the question implies more (e.g. only code, no design docs), |
| 66 | or a hit references something ("see the migration doc") not yet found. |
| 67 | |
| 68 | 4. **Follow up, don't restart.** Gaps become 1-3 new targeted searches — |
| 69 | reuse the vocabulary actually found in round 1 (a real error code, a |
| 70 | real doc title) instead of guessing more synonyms of the original |
| 71 | question. This is the step deep-searcher's LLM-driven query refinement |
| 72 | automated; here it's just another `mfs search` call informed by what |
| 73 | came back. |
| 74 | |
| 75 | 5. **Stop condition.** Whichever comes first: |
| 76 | - a round adds no new distinct objects (saturation), or |
| 77 | - every decomposed angle has a strong hit and no unresolved reference |
| 78 | remains, or |
| 79 | - **~4 rounds** (glance at whether the effort is still paying off, |
| 80 | don't hard-stop exactly at 4 if one more obvious query would close a |
| 81 | re |