LiyaEngine Docs

Data sources

Connect a database, a storage bucket, a JSON API or a website, and keep its content indexed and current on a schedule.

Dashboard

A data source connects LiyaEngine to somewhere your knowledge already lives. Each row, file, record or page becomes a document, and a schedule keeps those documents in step with the source: changes are re-indexed, and what disappears from the source disappears from search.

Open Knowledge → Data sources to create and manage them.

What you can connect

SourceOne document isNotes
PostgreSQL and MySQLa rowRead a table, or write your own SELECT.
S3 and compatible storagea fileAmazon S3, Cloudflare R2, MinIO, Wasabi. PDF, Word, Excel, CSV, Markdown and text are read like an upload.
JSON APIa recordPaging by page number, offset, cursor or Link header. Bearer token, API key or basic sign-in.
Websitea pageFollows links on the same site, up to a depth and page limit.

For apps such as Google Drive, Confluence, Notion, SharePoint and GitHub, use Connect an app when adding documents.

Test it before you save it

Fill in the connection and choose Test connection and preview. It connects, reads a few records, and shows the documents they would become. If it cannot connect it says why in plain words: the password was rejected, the table was not found, the address is not allowed. Nothing is saved by a test.

How a record becomes a document

For databases and APIs, you say which field identifies a record (the ID), which is its title, and which fields hold its text. The ID matters most: it is how a later sync recognises the same record and updates it instead of adding a copy. Leave the text fields empty to use every field.

Keeping it current

Choose how often to refresh: only when you sync it, every hour, every 6 hours, every day or every week. Each refresh:

  • adds documents for new records,
  • re-indexes records whose content changed,
  • skips records that have not changed, without re-reading or re-embedding them, so a refresh costs only what changed,
  • removes documents for records the source no longer lists.

A partial read never deletes anything

Removal only happens when a refresh read the whole source. If the source has more records than one run reads, or the refresh stops early, nothing is removed. A source that suddenly returns nothing also removes nothing. You can turn removal off per source.

A single refresh indexes at most 500 new or changed records. The rest follow on the next refresh, which skips what is already done. One record that cannot be read is counted and reported, and the rest carry on. A refresh that fails ten records in a row stops.

Sync history

A data source's page lists each refresh: how many records were new, changed, unchanged, removed and failed, whether it was a partial read, and the first problems found.

Where the documents go

Choose the collections the documents are added to. Retrieval profiles, access settings and how documents are split all apply through them, and you can set the splitting for the source itself. Changing a source's collections later moves its existing documents too.

Sync when something changes

A schedule is the simplest way to stay current. To refresh the moment something changes instead, call the sync endpoint from wherever the change is seen: an S3 event notification, a webhook from your CMS, or a step at the end of a deploy.

curl -X POST https://api.liyaengine.ai/v1/data-sources/$ID/sync -H "Authorization: Bearer $KEY"

It returns at once and the refresh runs in the background. A source that is already refreshing answers 409 SYNC_IN_PROGRESS, which you can ignore, and unchanged records are skipped, so calling it often costs little. It needs a full-access key.

Deleting a data source stops the syncing. Its documents stay in Documents as ordinary documents, unless you choose to delete them too.

Security

  • Credentials are encrypted when saved and never shown again, in the dashboard or the API. To change one, replace it.
  • Use read-only credentials. LiyaEngine only reads. Database queries run in a read-only transaction with a time limit and a row cap, and a custom SELECT is checked to be a single read.
  • Connections are encrypted. A database connection always uses TLS. You can choose to skip checking a self-signed certificate; a plain connection is never allowed.
  • Public addresses only. Data sources cannot reach private or internal networks, so a database or API must be reachable on a public address that allows our connection. Addresses are checked each time before connecting.
  • API keys. A runtime key cannot call the data sources API at all. A read key can list sources and see their history; changing or syncing one needs a full-access key.

See the Data sources API to manage them from code.

On this page