Skill Tracer
Skills › Scientific Agent Skills › paperclip › search-and-retrieval.md

search-and-retrieval.md

178 lines · skills/paperclip/references/search-and-retrieval.md at 5f2bc03

Open on GitHub
1# Search, retrieval, and query craft
2
3Reviewed on 2026-09-30 against the 0.7.92 CLI/SDK, the
4[core reference](https://paperclip.gxl.ai/skills/full_skill.md),
5[protein reference](https://paperclip.gxl.ai/skills/skills/proteins.md), and
6[web docs](https://paperclip.gxl.ai/docs). Retrieval examples are illustrative: no paid or
7authenticated searches were executed for this review. Load credentials as described in
8[installation.md](installation.md).
9

Search, retrieval, and query craft

Reviewed on 2026-09-30 against the 0.7.92 CLI/SDK, the core reference, protein reference, and web docs. Retrieval examples are illustrative: no paid or authenticated searches were executed for this review. Load credentials as described in installation.md.

Raw lines 1 to 9
10## Choose a source explicitly
12| Source | Scope |
13|---|---|
14| `pmc` | PMC full-text papers |
15| `arxiv`, `biorxiv`, `medrxiv` | Corresponding preprint corpora |
16| `papers` | The four paper corpora combined |
17| `abstracts` | Title/abstract-grain retrieval across scholarly corpora; not a full-text promise |
18| `fda` | Regulatory search; use a regional source/path to disambiguate |
19| `fda/jp`, `fda/eu`, `/fda/us` | PMDA, EMA/EPAR, and US FDA |
20| `trials` | Trial registries; `trials/us`, `trials/eu`, `trials/jp`, `trials/cn` narrow geography |
21| `proteins` | Unified UniProt/PDB/ChEMBL records; `uniprot`, `pdb`, `chembl` are aliases in the client |
22| `clipboard` | The user's documents; `clipboard/FOLDER` scopes to a folder |
23| `geo` | GEO Series (documented CLI source; not listed in the current v1 JSON search enum) |
24| `patents` | Patent records; load `paperclip skill patents` first |
26The `abstracts` CLI source and the public `/api/v1/search` default have different published coverage
27wording. Choose a source explicitly and report the selected interface; do not label all abstract
28results as OpenAlex or assume coverage equals PMC. Counts in upstream documents disagree and change,
29so use a dated catalogue or query result when a corpus count matters.
31```bash
32paperclip search -s pmc,biorxiv "protein design" -n 5
33paperclip search "pembrolizumab" /fda/us -n 5
34paperclip search "breast cancer" /trials/us -n 5
35```
37Match the task to paper evidence, trial registration, regulatory material, or structured protein
38records. Infer that choice from a clear user request; clarify only when the intended output remains
39ambiguous. Regional paths `/trials/...` and `/clinicaltrials/...` are aliases in current docs.

Choose a source explicitly

SourceScope
pmcPMC full-text papers
arxiv, biorxiv, medrxivCorresponding preprint corpora
papersThe four paper corpora combined
abstractsTitle/abstract-grain retrieval across scholarly corpora; not a full-text promise
fdaRegulatory search; use a regional source/path to disambiguate
fda/jp, fda/eu, /fda/usPMDA, EMA/EPAR, and US FDA
trialsTrial registries; trials/us, trials/eu, trials/jp, trials/cn narrow geography
proteinsUnified UniProt/PDB/ChEMBL records; uniprot, pdb, chembl are aliases in the client
clipboardThe user's documents; clipboard/FOLDER scopes to a folder
geoGEO Series (documented CLI source; not listed in the current v1 JSON search enum)
patentsPatent records; load paperclip skill patents first

The abstracts CLI source and the public /api/v1/search default have different published coverage wording. Choose a source explicitly and report the selected interface; do not label all abstract results as OpenAlex or assume coverage equals PMC. Counts in upstream documents disagree and change, so use a dated catalogue or query result when a corpus count matters.

paperclip search -s pmc,biorxiv "protein design" -n 5
paperclip search "pembrolizumab" /fda/us -n 5
paperclip search "breast cancer" /trials/us -n 5

Match the task to paper evidence, trial registration, regulatory material, or structured protein records. Infer that choice from a clear user request; clarify only when the intended output remains ambiguous. Regional paths /trials/... and /clinicaltrials/... are aliases in current docs.

Raw lines 10 to 40
41## Search options
43| Option | Contract |
44|---|---|
45| `-n/--limit N` | Requested hit count, not a corpus census or a pagination cursor |
46| `-e/--exact` | Exact-phrase search |
47| `--year YYYY` | Publication-year filter; validate returned metadata |
48| `--since WINDOW` | Recency strings such as `30d`, `6m`, `1y`; support depends on source |
49| `--sort relevance\|date` | Ordering |
50| `--author`, `--journal` | Metadata narrowing; source coverage varies |
51| `--ranking hybrid\|bm25\|vector\|analogical` | Retrieval mode |
52| `--min-embedding-similarity FLOAT` | Floor on the vector leg |
53| `--min-bm25-score FLOAT` | Floor on the lexical leg |
54| `--corpus` | Full-corpus discovery even when scoped to a repo |
56The SDK and vendor core reference disagree on arXiv `--since` support; use `--year` for arXiv,
57medRxiv, and abstracts unless current server help confirms the needed recency behavior. Do not
58assume an arbitrary date string or a filter unsupported by a source is applied.
60The relevance floors **do have CLI equivalents**. For hybrid mode, each applies only to its own
61retrieval leg: use both to bound both legs, or pair one with its matching ranking. Floors do not
62expand the requested candidate set. They are unsupported with regex/analogical modes; a vector
63floor is incompatible with date sorting. These restrictions are documented in the 0.7.92 SDK.
65```bash
66paperclip search -s pmc --ranking hybrid \
67 --min-embedding-similarity 0.7 --min-bm25-score 5 \
68 "protein design" -n 5
69```
71`hybrid` is a good discovery default; `bm25` fits exact terminology and gene symbols, `vector` fits
72varying vocabulary, and `analogical` fits cross-domain method transfer. Write one or two sentences
73about the method/problem for analogical search, or use an identified reference paper's abstract:
75```bash
76paperclip search -s arxiv --ranking analogical \
77 "I need to approximate an expensive leave-one-out computation cheaply by exploiting low-rank structure in my parameter space" -n 10
78```
80Upstream describes stable search prefixes through `-n 100` for unchanged query, filters, and index;
81requests above 100 can expand the candidate pool and reorder earlier results. This is not pagination
82or a cross-date reproducibility guarantee. Save exact queries, source filters, returned IDs, and date.

Search options

OptionContract
-n/--limit NRequested hit count, not a corpus census or a pagination cursor
-e/--exactExact-phrase search
--year YYYYPublication-year filter; validate returned metadata
--since WINDOWRecency strings such as 30d, 6m, 1y; support depends on source
`--sort relevance\date`Ordering
--author, --journalMetadata narrowing; source coverage varies
`--ranking hybrid\bm25\vector\analogical`Retrieval mode
--min-embedding-similarity FLOATFloor on the vector leg
--min-bm25-score FLOATFloor on the lexical leg
--corpusFull-corpus discovery even when scoped to a repo

The SDK and vendor core reference disagree on arXiv --since support; use --year for arXiv, medRxiv, and abstracts unless current server help confirms the needed recency behavior. Do not assume an arbitrary date string or a filter unsupported by a source is applied.

The relevance floors do have CLI equivalents. For hybrid mode, each applies only to its own retrieval leg: use both to bound both legs, or pair one with its matching ranking. Floors do not expand the requested candidate set. They are unsupported with regex/analogical modes; a vector floor is incompatible with date sorting. These restrictions are documented in the 0.7.92 SDK.

paperclip search -s pmc --ranking hybrid \
  --min-embedding-similarity 0.7 --min-bm25-score 5 \
  "protein design" -n 5

hybrid is a good discovery default; bm25 fits exact terminology and gene symbols, vector fits varying vocabulary, and analogical fits cross-domain method transfer. Write one or two sentences about the method/problem for analogical search, or use an identified reference paper's abstract:

paperclip search -s arxiv --ranking analogical \
  "I need to approximate an expensive leave-one-out computation cheaply by exploiting low-rank structure in my parameter space" -n 10

Upstream describes stable search prefixes through -n 100 for unchanged query, filters, and index; requests above 100 can expand the candidate pool and reorder earlier results. This is not pagination or a cross-date reproducibility guarantee. Save exact queries, source filters, returned IDs, and date.

Raw lines 41 to 83
84## Structured results and cohort preservation
86Search previews and generated summaries are triage, not paper quotations. In 0.7.92 SDK,
87`result.papers`, `result.count`, and `result.result_id` expose structured results and hydrate missing
88hit data from saved results when possible. A failed hydration can leave incomplete data: check
89requested versus returned count and reported truncation. See [python-sdk.md](python-sdk.md).
91```bash
92paperclip results --list
93paperclip results s_ID --save search.csv
94paperclip results s_ID --export-bundle cohort/
95paperclip results s_ID --sample 20 --seed 42
96```
98CSV exports and bundle formats depend on result kind; do not assume every map export has the search
99metadata header. Cohort paging retrieves the **saved cohort**, not additional corpus search hits.
100The CLI supports `--save-as NAME` aliases on result-producing commands; their scope is session-bound,
101so record the durable result ID for another session.
103```bash
104paperclip filter --from s_ID --require 3 "in vivo delivery with quantitative outcomes"
105```
107`filter` is an LLM pass that overwrites the cohort in place. If too few survive, rerun a broader
108search for a fresh ID; a second filter cannot recover discarded rows. For deterministic quality
109filters, consult current `refine --help` and preserve both input and output cohort IDs.

Structured results and cohort preservation

Search previews and generated summaries are triage, not paper quotations. In 0.7.92 SDK, result.papers, result.count, and result.result_id expose structured results and hydrate missing hit data from saved results when possible. A failed hydration can leave incomplete data: check requested versus returned count and reported truncation. See python-sdk.md.

paperclip results --list
paperclip results s_ID --save search.csv
paperclip results s_ID --export-bundle cohort/
paperclip results s_ID --sample 20 --seed 42

CSV exports and bundle formats depend on result kind; do not assume every map export has the search metadata header. Cohort paging retrieves the saved cohort, not additional corpus search hits. The CLI supports --save-as NAME aliases on result-producing commands; their scope is session-bound, so record the durable result ID for another session.

paperclip filter --from s_ID --require 3 "in vivo delivery with quantitative outcomes"

filter is an LLM pass that overwrites the cohort in place. If too few survive, rerun a broader search for a fresh ID; a second filter cannot recover discarded rows. For deterministic quality filters, consult current refine --help and preserve both input and output cohort IDs.

Raw lines 84 to 110
111## Exact metadata lookup
113```bash
114paperclip lookup doi 10.1073/pnas.2307796121
115paperclip lookup pmc PMC7194329
116paperclip lookup pmid 32943797
117paperclip lookup arxiv 2403.03507
118paperclip lookup author "James Zou" -n 10
119```
121Current docs list `doi`, `title`, `author`, `abstract`, `source`, `date`/`month_year`, `pmc`, `pmid`,
122`journal`, `publisher`, `type`, `keywords`, `category`, `license`, `year`, `volume`, `issue`, `issn`;
123the core reference also lists `arxiv`. Many metadata fields are PMC-specific. Do not turn an empty
124field match into a claim that the paper does not exist. The public HTTP lookup's narrower typed
125contract is documented separately in [python-sdk.md](python-sdk.md).

Exact metadata lookup

paperclip lookup doi 10.1073/pnas.2307796121
paperclip lookup pmc PMC7194329
paperclip lookup pmid 32943797
paperclip lookup arxiv 2403.03507
paperclip lookup author "James Zou" -n 10

Current docs list doi, title, author, abstract, source, date/month_year, pmc, pmid, journal, publisher, type, keywords, category, license, year, volume, issue, issn; the core reference also lists arxiv. Many metadata fields are PMC-specific. Do not turn an empty field match into a claim that the paper does not exist. The public HTTP lookup's narrower typed contract is documented separately in python-sdk.md.

Raw lines 111 to 126
127## Full-text grep and scan
129```bash
130paperclip grep -l "SLC30A8" /papers/
131paperclip grep -n -C 3 "lipid nanoparticle" /papers/PMC10945750/content.lines
132paperclip grep -i -e "off-target" -e "offtarget" /papers/PMC10945750/content.lines
133paperclip grep --from s_ID "IC50"
134paperclip scan -i -C 3 /papers/PMC10945750/content.lines "IC50" "EC50" "dose"
135```
137`-n` means line numbers; `-m N` bounds matches. Corpus scans are parallel and time-bounded, so a limit
138or timeout can change returned membership/order. `--exhaustive` allows more scan time, not guaranteed
139completeness. The current guide says corpus `grep -c` counts documents exactly only through 500 bitmap
140candidates, then approximately; file `grep -c` counts matching lines. Do not report a corpus estimate
141as an exact prevalence count.
143Boolean search and grep use different semantics: `search --bool --ranking bm25` uses analyzed phrase
144operands; `grep --bool` uses regex predicates over whole documents. Do not interchange them in a
145review protocol without validating the intended matching behavior.

Full-text grep and scan

paperclip grep -l "SLC30A8" /papers/
paperclip grep -n -C 3 "lipid nanoparticle" /papers/PMC10945750/content.lines
paperclip grep -i -e "off-target" -e "offtarget" /papers/PMC10945750/content.lines
paperclip grep --from s_ID "IC50"
paperclip scan -i -C 3 /papers/PMC10945750/content.lines "IC50" "EC50" "dose"

-n means line numbers; -m N bounds matches. Corpus scans are parallel and time-bounded, so a limit or timeout can change returned membership/order. --exhaustive allows more scan time, not guaranteed completeness. The current guide says corpus grep -c counts documents exactly only through 500 bitmap candidates, then approximately; file grep -c counts matching lines. Do not report a corpus estimate as an exact prevalence count.

Boolean search and grep use different semantics: search --bool --ranking bm25 uses analyzed phrase operands; grep --bool uses regex predicates over whole documents. Do not interchange them in a review protocol without validating the intended matching behavior.

Raw lines 127 to 146
147## Metadata SQL
149```bash
150paperclip sql "SELECT source, COUNT(*) AS n FROM documents GROUP BY source"
151paperclip sql "SELECT pub_year AS year, COUNT(*) AS n FROM documents WHERE title ILIKE '%CRISPR%' GROUP BY pub_year ORDER BY year DESC LIMIT 10"
152```
154The current core reference documents `SELECT` on `documents`, 15-second server timeout and a
155200-row cap. Its columns are `id`, `title`, `doi`, `authors`, `source`, `abstract_text`, `pub_date`,
156`pub_year`, `journal_title`, `article_type`, `pmid`, `keywords`, and `categories`.
157Source-specific missing fields may be NULL. Use explicit aliases and inspect actual returned columns.
159This metadata SQL route does not search paper bodies. `abstract_text ILIKE '%X%'` misses a term
160found only in Methods or supplementary material. The web docs expose lower-level `document_id`,
161`content_blocks`, and `figures` in an **export** context; do not assume those names or joins are
162interchangeable with ordinary `sql`. Current docs differ on some column naming, so check server help
163before introducing a new query rather than claiming automatic normalization.

Metadata SQL

paperclip sql "SELECT source, COUNT(*) AS n FROM documents GROUP BY source"
paperclip sql "SELECT pub_year AS year, COUNT(*) AS n FROM documents WHERE title ILIKE '%CRISPR%' GROUP BY pub_year ORDER BY year DESC LIMIT 10"

The current core reference documents SELECT on documents, 15-second server timeout and a 200-row cap. Its columns are id, title, doi, authors, source, abstract_text, pub_date, pub_year, journal_title, article_type, pmid, keywords, and categories. Source-specific missing fields may be NULL. Use explicit aliases and inspect actual returned columns.

This metadata SQL route does not search paper bodies. abstract_text ILIKE '%X%' misses a term found only in Methods or supplementary material. The web docs expose lower-level document_id, content_blocks, and figures in an export context; do not assume those names or joins are interchangeable with ordinary sql. Current docs differ on some column naming, so check server help before introducing a new query rather than claiming automatic normalization.

Raw lines 147 to 164
165### Protein SQL
167```bash
168paperclip skill proteins
169paperclip sql -s proteins "SELECT COUNT(*) FROM uniprot_v.proteins"
170paperclip sql -s proteins "SELECT * FROM pdb_v.structures_by_accession WHERE accession='P00533' LIMIT 10"
171paperclip cat /proteins/P04637/meta.json
172```
174The current domain reference exposes `uniprot_v.proteins`, `uniprot_v.features`,
175`pdb_v.structures_by_accession`, `chembl_v.bioactivities_by_accession`, and
176`chembl_v.drugs_by_accession`. Check that reference for exact column names, enum values, join
177cardinality, and accession mapping before writing a biological query. An accession-based join is
178not a guarantee of one row per protein or of directly comparable bioactivity assays.

Protein SQL

paperclip skill proteins
paperclip sql -s proteins "SELECT COUNT(*) FROM uniprot_v.proteins"
paperclip sql -s proteins "SELECT * FROM pdb_v.structures_by_accession WHERE accession='P00533' LIMIT 10"
paperclip cat /proteins/P04637/meta.json

The current domain reference exposes uniprot_v.proteins, uniprot_v.features, pdb_v.structures_by_accession, chembl_v.bioactivities_by_accession, and chembl_v.drugs_by_accession. Check that reference for exact column names, enum values, join cardinality, and accession mapping before writing a biological query. An accession-based join is not a guarantee of one row per protein or of directly comparable bioactivity assays.

Raw lines 165 to 178