Skip to main content
A datasource is where Meibel keeps the data your agents draw on. It holds two shapes of content: unstructured documents and structured tables. Uploading a file only begins the process: when a datasource ingests your files, it parses each one, recovers the structure inside it, and extracts metadata as it goes. Your documents become data elements an agent can search by meaning, and your tables, along with other data suited to tabular representation, become queryable by their columns and values. By the time ingestion finishes, an agent bound to the datasource can retrieve from your files directly as it reasons through a task. This guide walks through the full datasource lifecycle: creating a datasource, uploading files, triggering ingestion, retrieving its details and status, updating it, and deleting it. By the end you will know how to take a datasource from empty to queryable and how to manage it as your content changes. For detailed explanations of what a datasource is and how agents query it, see the Datasources concept. To learn how to configure the metadata you can search and scope by, see Managing datasource metadata. The examples work on one datasource throughout: Q4 Financial Reports, which holds quarterly earnings reports and analyst briefings. It starts with a single uploaded PDF, earnings-q4.pdf, and each step below acts on that same datasource, so the snippets follow in order as one walkthrough. Set your API key in the MEIBEL_API_KEY environment variable before you begin.

Create a datasource

Every datasource starts empty. You create one with a name and a description to organize it by. You supply its content yourself by uploading files, which the next step covers.
The response includes the datasource id, name, description, and timestamps. Every operation that follows needs this id. The snippets reuse the datasource object returned here, so keep it in scope as you work through the steps.

Upload files

With a datasource in place, add the files whose contents you want agents to reach. Each call uploads one file, so repeat it for every file you want to add. The SDK streams the file to the server in chunks rather than loading it into memory first, so a large document uploads without exhausting memory. Uploading stores a file but does not process it. Its contents become searchable only after ingestion, which the next step triggers.
You can upload multiple files to the same datasource. Supported formats include PDF, DOCX, XLSX, CSV, TXT, and JSON.

Trigger ingestion

Ingestion is the step that turns uploaded files into queryable content. The pipeline parses each file, breaks documents into data elements, reads structured files into tables, and extracts metadata along the way. Trigger it once your files are in place. You can trigger it again later after adding more files or changing the datasource’s metadata configuration, and the pipeline reprocesses the content accordingly.
Ingestion runs asynchronously, so the call returns before processing finishes. Track its progress by polling the datasource’s status, described next, or by subscribing to streaming events.

Get datasource details

Fetching a datasource returns its current state, which is how you check where it stands. The last_sync_status field reflects the most recent ingest run, and total_ingested_files reports how many files have been ingested. Read the status here to confirm ingestion has finished before you rely on the datasource in an agent.

Update a datasource

Updating changes a datasource’s name, description, or configuration after you create it. Here you rename Q4 Financial Reports to add the year and record that it now reflects the final audited numbers. The update is partial: only the fields you include in the request body change, and anything you leave out keeps its current value. Changing configuration that affects how content is processed, such as the metadata shape, takes effect on the next ingestion rather than immediately.

Delete a datasource

Deleting removes a datasource along with every file and data element it holds. The removal is permanent, so reserve it for datasources you are sure you no longer need, and check what depends on the datasource before you delete it.
Deleting a datasource removes all uploaded files and extracted data elements. Agents that reference this datasource will lose access to its content.