Skip to main content
Archil disks in AWS regions provide a native integration with SQLite that enables you to create and work with an unlimited number of SQLite databases on your disk. This is ideal for AI agents which store their context as a combination of structured and unstructured data. The Archil SQLite integration can be used from multiple clients simultaneously, even for writes. You don’t need to manage any resources in order to use the SQLite APIs, and you’re only charged for the compute that’s used while queries are running. The SDK for the Archil SQLite integration is currently available for TypeScript users, in a separate package, which can you install with any Node package manager:

Create and manage SQLite databases

To create a new SQLite database on your Archil disk, use the createDatabase function and pass in the disk and the name of the database file. You can then use the getDatabase function to retrieve the database later.
createDatabase will create a new SQLite database on the disk if it doesn’t exist, or return the existing database if it does. getDatabase will return an existing database.

Execute SQL queries

You can execute SQL queries against each database using the read and write methods. The read method is used for queries that return data, while the write method is used for queries that modify data.
Why is there a difference between read and write? write queries need exclusive write access to the database file, while many read queries can be executed in parallel.
You can execute multiple queries in a single transaction using the transaction method. This ensures that either all queries succeed or none of them are applied.