# Data model

> Tasks, steps, approvals, budgets and memory.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://agent.docs.sypnia.com/architecture/data-model/

For agents: Schema agent (Sypnia Data in Cloud; SQLite locally): tasks(id, owner, repository, case_ids, request, state, budget_credits, held, spent, branch, pull_request), steps(task_id, n, kind: model|command|tool|question|approval, input, output_ref, cost, tier, at), approvals(id, task_id, action, effect, state, decided_by, at), questions(id, task_id, text, choices, answer), memory(id, scope person|project, owner, project, text, why, at), profiles(user_id, level, explain, shows, language, test_at), rules(team/project, yaml). Large outputs in S3 (logs, artifacts).

| Table       | Holds                                                                                 |
| ----------- | ------------------------------------------------------------------------------------- |
| `tasks`     | owner, repository, cases, request, state, budget held and spent, branch, pull request |
| `steps`     | every step: model call, command, tool call, question, approval; its tier and its cost |
| `approvals` | the action, its exact effect, the decision, who decided and when                      |
| `questions` | what was asked, the choices, the answer                                               |
| `memory`    | notes per person or per project, each with why and when                               |
| `profiles`  | level and preferences from the knowledge test                                         |
| `rules`     | team and project permission rules                                                     |

In Sypnia Cloud these tables live in a Sypnia Data project, with row-level security per person and team. Locally they are a small file database in `~/.config/sypnia/agent/`. Large outputs (full command logs, build artifacts) are stored as files (S3 in Cloud), referenced from the steps.
