Quickstart
Start with an example document and inspect the returned evidence. You need an API key first; if you do not have one yet, see Your API key.
1. Install
pip install searchcandy
2. Set your key
export SEARCHCANDY_API_KEY=sc_live_...
3. Add documents and ask
from searchcandy import SearchCandy
sc = SearchCandy()
# Create a sample file; use a separate folder for this example.
from pathlib import Path
folder = Path("./searchcandy-quickstart")
folder.mkdir(exist_ok=True)
(folder / "services-agreement.md").write_text(
"Either party may terminate this agreement with sixty days' written notice.",
encoding="utf-8",
)
sc.ingest_folder(str(folder))
r = sc.query("What is the termination notice period?")
if r.not_covered:
print("No supporting passage returned.")
else:
for quote in r.quotes:
print(quote.text, quote.source_id)
t = sc.query("What does clause 99.9 say?") # the sample has no such clause
print(t.not_covered) # Inspect the coverage result.The first ingest builds your graph, which takes a moment. Indexing and query timings depend on document size, workload, and network conditions.
What you just did
Your sample document was submitted to your graph. Passages come with sources you can check, and the second question lets you inspect missing-evidence handling. Inspect the actual results before connecting the flow to your application.
Next: Adding documents →