Daita agents / guide
CSV and JSON
Attach a contained local directory and let the agent discover and read bounded CSV and JSON resources.
#Attach a Directory
source = await agent.attach_local_directory(
"/absolute/path/exports",
name="Daily exports",
)Or configure explicit discovery bounds:
from daita import LocalDirectorySource
source = await agent.attach(
LocalDirectorySource(
"/absolute/path/exports",
name="Daily exports",
max_depth=4,
max_files=500,
max_file_bytes=2 * 1024 * 1024,
max_rows=100_000,
)
)Only .csv and .json files are admitted. The root must be an absolute, canonical, non-symlink directory.
#Discovery
Daita recursively discovers files within the configured depth and count limits. It records file identity, revision, format, columns, row counts, and freshness facts in the catalog.
CSV files are decoded as strict text and parsed as tabular rows. JSON must fit the configured node, depth, key, string, and cell bounds.
#Read Tool
The model uses data_read_file with an exact source_id and catalog resource_id. It cannot supply an arbitrary filesystem path.
result = await agent.run(
"Summarize orders.csv by status",
source_id=source.id,
)The returned projection reports row and byte limits, returned and total rows, truncation status, file and source revisions, and a trust classification.
#Containment
Daita verifies containment and file identity during discovery and again during reads. Symlink traversal, .. segments, path replacement, non-regular files, and resources outside the attached root are rejected.
#Refresh
Refresh after adding, removing, or replacing files:
await agent.refresh_source(source.id)A read is rejected when the current file no longer matches the cataloged revision. Refresh commits the new structural truth.