Ingest
What does the Import tab do?
The Import tab is part of the Explorer view, accessible at /memories/:memoryId/import (the fourth tab alongside Grains, Graph, and Timeline). It provides a drag-and-drop upload interface for importing documents into the Areev context database as structured AI memory grains.
Drop a file onto the upload zone or click to select one from your filesystem. The autonomous memory engine accepts MG containers (up to 512 MB), PDF, DOCX, PPTX, HTML, and TXT files (up to 10 MB each). For document files (non-MG), the engine extracts text content, splits it into chunks, and stores the resulting grains. For .mg files, the engine imports pre-existing grains directly from the binary container via POST /api/memories/{memory_id}/import-file.
The Import tab walks through three steps: upload (drag-and-drop), importing (live progress with percentage and grain counts), and completion (summary of imported and skipped grains). Failed imports show the specific error (invalid format, file too large, too many active imports) and allow you to retry.
How does document import work?
Document import uses an asynchronous job-based pipeline. When you upload a document file (PDF, DOCX, PPTX, HTML, TXT), the Console sends it to POST /api/memories/{memory_id}/imports, which returns a job_id and streaming URL. The Console then connects to the job’s SSE stream at /api/memories/{memory_id}/imports/{job_id}/stream for real-time progress updates.
The pipeline processes the document through stages: accepted, parsing, analyzing, and writing. The progress indicator shows the percentage complete and the number of grains written, skipped, and failed. You can cancel an in-progress import via POST /api/memories/{memory_id}/imports/{job_id}/cancel.
For .mg container files, the import is synchronous — the file is sent as an application/octet-stream body to POST /api/memories/{memory_id}/import-file and the response includes the count of imported and skipped grains.
You can review and browse the imported grains in the Explorer’s Grains tab after import completes.
# Import a document (async job-based)
curl -X POST http://localhost:4009/api/memories/{memory_id}/import-document \
-F "file=@report.pdf"
# Import an .mg container (synchronous)
curl -X POST http://localhost:4009/api/memories/{memory_id}/import-file \
-H "Content-Type: application/octet-stream" \
--data-binary @export.mg
# Python: import a document
import requests
memory_id = "my-memory"
with open("report.pdf", "rb") as f:
resp = requests.post(f"http://localhost:4009/api/memories/{memory_id}/import-document", files={
"file": ("report.pdf", f, "application/pdf")
})
print(resp.json())
How do I monitor import progress?
The Import tab updates in real time via server-sent events as the server processes the file, showing percentage complete, grains written, grains skipped, and elapsed time.
The progress indicator cycles through pipeline stages: accepted (queued), parsing (extracting text), analyzing (classifying chunks), and writing (persisting grains). If the SSE connection drops, the Console falls back to polling GET /api/memories/{memory_id}/imports/{job_id} for status updates. The server processes files independently of the Console session — if you navigate away and return, the Console checks for any active imports on load and resumes showing their progress.
Related
- Console: Console overview and setup
- Explorer: Browse imported grains
- Ingest Guide: Ingest concepts and API reference