Daita agents / guide
Data Sources
Attach, select, refresh, inspect, and detach read-only SQLite, PostgreSQL, CSV, and JSON sources.
#Source Model
A source is explicitly attached to one persistent agent. Attachment admits the source configuration, discovers structural metadata, and commits a current catalog snapshot before the source becomes available to runs.
Daita currently supports:
#Attach
Use the focused convenience methods:
sqlite = await agent.attach_sqlite(
"/absolute/path/sales.db",
name="Sales",
)
files = await agent.attach_local_directory(
"/absolute/path/exports",
name="Exports",
)or pass a public source record:
from daita import LocalDirectorySource, SQLiteSource
registration = await agent.attach(
SQLiteSource("/absolute/path/sales.db", name="Sales")
)SourceRegistration contains a stable source ID, adapter identity, display name, admitted non-secret configuration, lifecycle timestamps, and active status.
#Select a Source
sources = await agent.list_sources()
selected = await agent.select_source("Sales")
active = await agent.active_source()Selectors accept an active source ID, display name, or unambiguous display-name alias. A conversation can pin its own source independently of the default selection.
#Scope a Run
result = await agent.run(
"Summarize last month's revenue",
source_id=selected.id,
)If several sources are attached and no source is selected or pinned, Daita requires an unambiguous source choice rather than guessing.
#Refresh
registration = await agent.refresh_source(selected.id)Refresh reopens the persisted admitted configuration, rediscovers structure, and atomically replaces the current snapshot only after successful discovery. A failed or cancelled refresh does not replace the last committed catalog.
#Detach
detached = await agent.detach(selected.id)Detachment disables future access. It never changes source data. A Daita-owned PostgreSQL keychain credential is deleted; the non-secret inactive registration remains as lifecycle history until the agent itself is deleted.
Headless automation must confirm detachment:
daita detach atlas <source-id> --yes#Catalog
Every active source has one current catalog snapshot used for source identity, resources, fields, relationships, and freshness. Continue with Catalog and Read-only Querying.