Adding documents
Plain text and markdown, through one call. Every add, update, or removal becomes a new saved version of your graph.
A folder at once
sc.create_graph("client-contracts") # once; the examples below use it
sc.ingest_folder("./contracts", store="client-contracts")Files it cannot take are named in the result with the reason. Nothing is ever skipped silently. Other formats we convert with you during onboarding.
Single documents from your own app
sc.ingest([{"source_id": "policy.md", "content": text}],
store="client-contracts")source_id is your name for the document, and it comes back on every answer that quotes it.
Updates never duplicate
Sending a source_id that already exists updates that document. Its old passages stop answering and the new ones start, in the same version. You never end up with two copies of a policy fighting each other.
Removing
rep = sc.remove(["old-addendum.md"], store="client-contracts") rep.removed # ["old-addendum.md"] rep.version # the new version number
Removal takes the document out of current answers. Earlier versions still contain it, so history stays complete. To erase a document from our disks entirely, delete the graph.
While a change is indexing, that graph pauses answering, and the change lands as one new version when it finishes. A few documents take seconds. At very large sizes the pause can take minutes, so load big batches at a quiet moment.