1. Create a project
Use Create a project to create a project for your documents. The response includes anid, which you pass as project_id in later API calls.
2. Upload your documents
Use Upload a document to add files to the project. This endpoint acceptsmultipart/form-data, not JSON.
The request accepts these fields:
file: Required. A PDF, Word (DOCX), Excel (XLSX), PowerPoint (PPTX), Markdown, plain text, HTML, CSV or image (PNG, JPEG, TIFF, BMP, WebP) file, up to 5 MB and 30 pages, with up to 8 scanned pages. See Supported files.session_id: Required.project_id: Optional. Associates the document with your project. Without it, the document goes into general memory.domain: Optional.
DOCUMENT_VERIFIED memory.
The response includes chunks_stored, the number of memories made from the file (for a file that is already in the project, the number in the existing source), and source_id, the project source identifier. When no project_id is supplied, source_id is null.
400: The document could not be read (INVALID_DOCUMENT), is a password-protected PDF (PASSWORD_PROTECTED) or has no usable text (NO_USABLE_CONTENT).409: The same file is already being processed in the project (DUPLICATE_IN_PROGRESS).413: The file is over 5 MB (FILE_TOO_LARGE), has more than 30 pages (TOO_MANY_PAGES), has more than 8 scanned pages (TOO_MANY_SCANNED_PAGES) or contains too much content (TOO_MUCH_CONTENT). Split it into parts.415: The file type is not supported.503: EDN is processing another document (BUSY), or the save did not finish and nothing was stored (WRITE_TIMEOUT,WRITE_INCOMPLETE). Documents are processed one at a time, so upload them one after another, and retry after theRetry-Afterheader.
already_present: true.
3. Check that the documents are ready
Use List project documents to retrieve the project’s documents, newest first. Each document includes:ingest_status:pendingwhile EDN processes the document,readywhen it can be searched, orfailedif it could not be read.chunk_count: The number of memory records created from the document.error_codeanderror_message: Why afaileddocument was not stored. Some failures are stored asPROCESSING_FAILED, and documents that failed before these fields existed havenull. Uploading the same file again retries it.
ingest_status is ready before using the document for retrieval.
4. Build a SIP from the project
Use Build a SIP to retrieve the memory relevant to the user’s question. Send:query: What the user just asked.session_id: The conversation session.project_id: The project containing your documents.
project_id, EDN uses only that project’s memory and documents. Set include_global to true to also use general memory.
The response includes:
sip: The context text to place in the model’s prompt, ahead of the user’s message.records_used: The number of memory records included in the SIP.citations: The sources associated with numbered items in the SIP.grounded:truewhenproject_idwas supplied.
[1], [2] and so on. Citable memories are DOCUMENT_VERIFIED, USER_STATED and USER_CONFIRMED. All sections of the same document share one citation number.
Saved exchanges (ROUND) appear without a number and are never cited. Unconfirmed AI memories, replaced memories and deleted memories are never included.
5. Ask the model to cite its sources
Place the returnedsip in the model’s prompt, ahead of the user’s message. Ask the model to cite the numbered sources [n] it uses in its answer.
The citations response contains one entry for each citation number, with these fields:
index: The number represented by[n].summary: The memory content associated with the citation.provenance: The memory’s provenance class.source_id: The document source identifier, or null for other memory.source_title: The document title, or null for other memory.record_id: The memory record identifier.supporting_record_ids: Every memory record from that source that was used.
index to match each [n] in the model’s answer to its source. Display source_title to show the user which document supports the cited information.
6. When the project has no answer
When a project SIP build finds nothing relevant to the question, the response setsabstain to true.
The SIP instructs the model to answer only from the project’s sources and to state plainly that the project has no sources on that topic, rather than guessing.
7. Keep the conversation in the project
Use Save a conversation turn after each user-assistant exchange, passing the sameproject_id.
This saves the exchange in the project so later SIPs for that project can use it as context.
8. Remove a document
Use Remove a project document to remove a document from the project. Provide thesource_id returned by Upload a document or List project documents.
EDN removes the document and every memory created from it, so none of them is used again in SIPs, search or lists. Signed records of earlier SIPs keep the text those SIPs contained.
The response includes records_removed, the number of memory records removed.
Next steps: See Build a SIP and Upload a document for the API reference.
