# Treasure AI Studio: Project Setup Guide

Koshi Nakamura
## What is the Project Feature?

When using AI products, you may experience situations where the same prompt produces different results, or where you don't get the intended output. This is often because AI doesn't have sufficient context about what it needs to execute until the moment of execution, and its behavior is probabilistic.

Treasure AI Studio provides various skills ready for immediate use. However, by making your business context, data information for analysis, and analysis rules available for reference before executing queries or generating outputs, you can achieve more consistent quality and expected results.

The Project feature in Treasure AI Studio is a mechanism to **maintain shared context** across chat sessions. By storing data schemas, business rules, and past design decisions in a project, you can eliminate repetitive explanations.

This blog introduces examples of how to use Projects. Please adapt the content according to your business and data situation.

## Example Folder Structure

For example, the following structure is easy for agents to read:


```
/home/agent/projects/<your-project-name>/
│
├── CLAUDE.md                     # Project configuration file (references other files via @import)
│
├── skills/
│   ├── data-schema.md            # Table and column definitions
│   └── business-rules.md         # KPI definitions, naming conventions, business rules
│
└── memory/
    ├── MEMORY.md                 # Index file
    └── decisions.md              # Design decision records
```

### Role of Each File

| File | Purpose |
|  --- | --- |
| **CLAUDE.md** | Overall project settings. Loads skills/ and memory/ via `@import` |
| **skills/data-schema.md** | Defines available tables, columns, and data types |
| **skills/business-rules.md** | KPI calculation formulas, permitted dimensions/metrics, naming conventions |
| **memory/MEMORY.md** | Memory index (auto-generated) |
| **memory/decisions.md** | Records past design decisions and important notes |


## Setup Steps

### Step 1: Create a Project

1. Log in to Treasure AI Studio
2. Click **"Projects"** in the left sidebar
3. Click **"New Project"**
4. Enter a project name (e.g., `customer-journey-analysis`)


![Project creation screen](/assets/01-project-creation.718098d1e86dc3c92dc3ddf3d8e4716d322c8f1bf2007416bd78bf8f9fcbc004.94e46156.png)

### Step 2: Create Folder Structure

When you create a new Project, `/home/agent/projects/<your-project-name>/` is automatically created. The `skills/` and `memory/` subfolders, however, are not created automatically — you need to create them yourself.

You can ask TAIS to create them by simply typing in a chat within the Project:

> "Please create the folders `skills/` and `memory/` inside this project."


Alternatively, you can run the following commands directly for a quick and reliable setup:


```bash
mkdir -p /home/agent/projects/<your-project-name>/skills
mkdir -p /home/agent/projects/<your-project-name>/memory
```

![File tree within Project](/assets/02-file-tree.8e60c11488aba292cda236718d8a756fe2d4c7c6f339fb2350331bb74b9602f9.94e46156.png)

### Step 3: Create skills/data-schema.md

By clearly defining the data schema, AI can reference the correct tables and columns.


```markdown
# Data Schema

## Table List

### members (Member Table)
| Column | Type | Description |
|--------|------|-------------|
| member_id | STRING | Member ID (PK) |
| age_group | STRING | Age group ('20s', '30s', '40s', '50s+') |
| member_stage | STRING | Member stage ('bronze', 'silver', 'gold', 'platinum') |
| registered_at | TIMESTAMP | Registration timestamp |

### card_transactions (Card Transaction History)
| Column | Type | Description |
|--------|------|-------------|
| transaction_id | STRING | Transaction ID (PK) |
| member_id | STRING | Member ID (FK: members) |
| amount | DECIMAL | Transaction amount |
| transaction_date | DATE | Transaction date |
| category | STRING | Category |

## Permitted Tables

AI can only reference the following tables:
- members
- card_transactions

**Access to any other tables is prohibited**
```

### Step 4: Create skills/business-rules.md

By fixing business rules, you can prevent AI from making "incorrect interpretations."


```markdown
# Business Rules

## Permitted Dimensions

| Dimension Name | Corresponding Column | Permitted Values |
|---------------|---------------------|------------------|
| Age Group | age_group | '20s', '30s', '40s', '50s+' |
| Member Stage | member_stage | 'bronze', 'silver', 'gold', 'platinum' |

## Permitted Metrics

| Metric Name | Calculation Formula | Description |
|-------------|---------------------|-------------|
| Card Transaction Amount | SUM(amount) | Total transaction amount within period |
| Transaction Count | COUNT(transaction_id) | Number of transactions within period |
| Average Transaction Amount | AVG(amount) | Average amount per transaction |

## Time Period Rules

- "Last 3 months" → `WHERE transaction_date >= DATE_SUB(CURRENT_DATE, INTERVAL 3 MONTH)`
- "Year 2024" → `WHERE YEAR(transaction_date) = 2024`

**If users specify undefined metrics or time periods, return an error message without generating SQL**
```

### Step 5: Configure CLAUDE.md

`CLAUDE.md` is the configuration file loaded in all sessions. Since there is no direct editor in Treasure AI Studio, open a chat within the Project and ask TAIS to write it:

> "Please write the following content to `CLAUDE.md` in this project:
{paste the content below}"



```markdown
# Project: Customer Journey Analysis

This project performs journey analysis from customer behavior data.

## Data Schema
@import skills/data-schema.md

## Business Rules  
@import skills/business-rules.md

## Guidelines

- **AI's Role**: Extract conditions (age group, time period, metrics) from user's natural language requests
- **System's Role**: Insert conditions into predefined SQL templates and execute
- SQL structure (JOIN, GROUP BY, aggregation logic) is fixed and must not be freely modified by AI
```

> **Note**: `@import` does not automatically load all files in the project. It only loads the specific files you explicitly list. Make sure the paths match the files you created in Steps 3 and 4.


![CLAUDE.md editing screen](/assets/03-claude-md-import.ef315c1f71bb1edc1deb796d10b4fca54f246bac2a2bddcf1be1f5e51fd4a6e0.94e46156.png)

## Design Philosophy: Restricting AI's Role

The core of this fixed approach is **clearly separating what AI handles and what it doesn't**.

### ✅ What AI Handles (Interpretation & Configuration)

- Extract conditions from user's natural language requests
- Map conditions like "by age group" or "last 3 months" to appropriate values
- Determine the appropriate scenario from the predefined "6 business menus"


### ❌ What AI Does NOT Handle (Logic Construction)

- Freely decide which tables to reference or how to JOIN them each time
- Create new KPIs or custom calculation formulas arbitrarily
- Use undefined columns or attributes
- Generate and execute SQL outside the defined rules


## Best Practices

### 1. Fixed SQL Template Types

This is an **optional** technique. You don't need it to get started — but it becomes valuable when you notice any of the following:

- Query results vary across sessions even for the same question
- A specific type of analysis keeps failing
- You always want to exclude certain records from a calculation


By adding SQL templates to `skills/business-rules.md`, you give AI a fixed structure to follow, which leads to more stable and predictable query generation:


```markdown
## Cross-Tabulation SQL Template

```sql
SELECT
  {row_dimension},
  {column_dimension},
  {aggregation_metric}
FROM {predefined_reference_table}
WHERE {predefined_time_condition}
GROUP BY {row_dimension}, {column_dimension}
```

**Only the {} placeholders can be replaced by AI. Everything else is immutable**
```

### 2. Three-Layer Guardrails with Master Definitions

Implement these three levels of guardrails by copying the Validation Rules block below into your `CLAUDE.md`:

**Guardrail 1: Limit Data Scope**

- Physically restrict accessible tables for each business scenario
- Example: Cross-tabulation Agent only has access to `members` and `card_transactions`


**Guardrail 2: Use Only Master-Defined Items**

- AI does not interpret independently; only maps user instructions to predefined "dimension/attribute masters"


**Guardrail 3: Stop Execution for Undefined Requests**

- If specified items don't exist, conditions are ambiguous, or combinations are unexpected → stop without generating SQL and guide the user


Open a chat within your Project and ask TAIS:

> "Please append the following to `CLAUDE.md` in this project:
{paste the content below}"



```markdown
## Validation Rules

Before execution, check the following:
1. Are the extracted "age group" and "member stage" in the permitted dimension master?
2. Is "card transaction amount" a predefined metric?
3. Is the time period "last 3 months" within the permitted range?
4. Is external export in a permitted format?

**If any check fails, stop execution and return to the user**
```

### 3. Record Design Decisions in memory/decisions.md

**(Optional)** This file is not required when starting a new project. It becomes useful once your project is in operation and you want to preserve the **reasoning behind rules** — not the rules themselves, but *why* they were set that way.

Use `decisions.md` when you want to record:

- Why a specific calculation method was chosen
- What went wrong in a past analysis and how it was resolved
- Context that can't be captured in the rule files themselves


Keep in mind: if a rule *changes*, update `business-rules.md` or `data-schema.md` directly — don't just add a note here. Also, keep entries concise. Long files risk being partially ignored by AI.


```markdown
# Design Decisions

## 2026-05-20: Standardized "Average" Calculation to Member-Level

**Background**: Initially calculated AVG(amount) at transaction level, but sales team requested "member-level average."

**Decision**: 
- `AVG(amount)` → `SUM(amount) / COUNT(DISTINCT member_id)`
- Updated metric definition in business-rules.md

**Reason**: To distinguish between cases where 1 person makes 100 transactions vs. 100 people making 1 transaction each
```

## Summary

We have introduced how to use Treasure AI Studio's Project feature more effectively in the following ways:

1. **Consistency**: Share the same data schemas and business rules across all chats
2. **Safety**: Limit AI's degrees of freedom and structurally prevent incorrect SQL generation
3. **Efficiency**: Eliminate repetitive explanations and accelerate implementation speed