Jiro uses Entity Framework Core with a relational database to store conversation data, user information, and session management.
- AppUser - User accounts and profile information
- AppRole - User roles and permissions
- AppUserRole - Many-to-many relationship between users and roles
- ChatSession - Individual chat sessions between users and the AI
- Message - Individual messages within chat sessions
AppUser (1) ←→ (Many) ChatSession
ChatSession (1) ←→ (Many) Message
AppUser (Many) ←→ (Many) AppRole (via AppUserRole)
AppUser (1) ←→ (Many) RefreshTokenThe system supports different message types:
- User messages
- AI assistant responses
- System messages
- Error messages
The database context is configured in JiroContext.cs with:
- Entity configurations
- Relationship mappings
- Database constraints
- Indexing for performance
For implementation details, see the Infrastructure namespace in the API documentation.