Quickstart

From install to a grounded answer in about ten lines. 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()

# point it at a folder of .txt or .md files
sc.ingest_folder("./contracts")

r = sc.query("What is the termination notice period?")
print(r.quotes[0].text)        # the exact passage
print(r.quotes[0].source_id)   # the file it came from

t = sc.query("What does clause 99.9 say?")   # not in the docs
print(t.not_covered)           # True. No guess, no filler.

The first ingest builds your graph, which takes a moment. A small folder is ready in seconds; queries after that return in well under a second.

What you just did

Your documents became a knowledge graph with a saved version 1. Answers come with sources you can check, and a question the documents cannot answer was turned away honestly. That is the whole product in four calls.

Next: Adding documents →