Home / Docs / Managing Data

Managing Data

Your agent's service database lives in the data/ folder. This is where you store product listings, user records, FAQs, or any structured information your agent needs. You can build this database without writing any code.

JSON Files

The simplest approach. Drop JSON files in the data/ folder:

// data/products.json
[
  {
    "id": "iphone-15-pro-001",
    "model": "iPhone 15 Pro",
    "storage": "256GB",
    "color": "Natural Titanium",
    "condition": "Excellent",
    "battery_health": 94,
    "price": 950,
    "available": true,
    "listed_by": "ahmed",
    "listed_at": "2026-03-15"
  },
  {
    "id": "iphone-14-002",
    "model": "iPhone 14",
    "storage": "128GB",
    "color": "Blue",
    "condition": "Good",
    "battery_health": 87,
    "price": 520,
    "available": true,
    "listed_by": "maria",
    "listed_at": "2026-03-20"
  }
]

You can have as many JSON files as you want. The agent searches across all of them.

SQLite Database

For larger datasets or when you need relationships between tables, use SQLite:

-- The agent can create and manage tables using the run_query tool
CREATE TABLE products (
  id TEXT PRIMARY KEY,
  model TEXT,
  storage TEXT,
  condition TEXT,
  price REAL,
  available BOOLEAN DEFAULT 1
);

Place a database.sqlite file in data/ or let the agent create one through conversations.

Ways to add data

  • Drop files: Create JSON files and place them in the data/ folder directly
  • Dashboard: Use the Data page in the web dashboard to create and edit files visually
  • Upload: Drag and drop files into the Data page
  • Conversation: Tell the agent to add records during chat. It will create or update data files on its own
  • CLI: Use echo '{"key":"val"}' | aaas data add file.json to add records from the command line

Agent data tools

The agent has access to these tools automatically during conversations:

search_dataSearch across all JSON files and SQLite tables
add_data_recordAdd a new record to a JSON file or table
update_data_recordModify an existing record
delete_data_recordRemove a record
run_queryExecute raw SQL queries (admin mode only)
list_tablesShow all SQLite tables and their structure

These tools are available by default. You do not need to configure or enable them.