Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Data Elements

Data elements are the individual pieces of knowledge extracted from your datasource files during ingestion. Each element represents a discrete chunk of content (a paragraph, table, figure, or section) that agents can retrieve and cite. This guide covers listing, searching, inspecting, and updating data elements.

List data elements

Retrieve all data elements for a datasource. Results are paginated automatically by the SDK iterator.
import os
from meibel import MeibelClient

client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])

for element in client.data_elements.list_data_elements(datasource_id="ds_123"):
    print(f"{element.id}: {element.content[:80]}...")
The iterator handles cursor-based pagination transparently. Each element includes id, content, metadata, and source file information.

Get a data element

Retrieve the full details of a specific data element, including its content, metadata, and source location.
element = client.data_elements.get_data_element(
    datasource_id="ds_123",
    data_element_id="de_456",
)

print(element.id)
print(element.content)
print(element.source_file)
print(element.metadata)

Search data elements

Search across data elements within a datasource using semantic or keyword queries. This is useful for previewing what an agent would retrieve for a given question.
from meibel.models import DataElementSearchRequest

results = client.data_elements.search_data_elements(
    datasource_id="ds_123",
    body=DataElementSearchRequest(
        regex_filter="quarterly revenue",
    ),
)

for result in results:
    print(f"[{result.score:.2f}] {result.content[:100]}...")
Each result includes a relevance score, the element content, and its id for further inspection. Higher scores indicate stronger matches.

Update a data element

Modify a data element’s content or metadata. This is useful for correcting extraction errors or enriching elements with additional context.
from meibel.models import UpdateDataElementRequest

updated = client.data_elements.update_data_element(
    datasource_id="ds_123",
    data_element_id="de_456",
    body=UpdateDataElementRequest(
        content="Corrected content with accurate figures for Q4 2025.",
        metadata={"reviewed": True, "reviewer": "finance-team"},
    ),
)

print(updated.id)
print(updated.content)
Updating a data element’s content triggers re-embedding so that search results reflect the new content. This happens automatically in the background.