The missing manual for your codebase.

Code comments only explain how— Mento reveals the important why.

Where code meets the bigger picture.

Working on issue #312/optimistic-mutations
packages / database / src / db.ts
1/**
2 * {@link https://getmento.dev/my-org/docs/packages/database}
3 *
4 * (Auto-generated by Mento)
5 * Types and implementation for the optimistic mutation system that handles
6 * local-first database operations with eventual consistency.
7 */
8
9interface OptimisticMutation {
10 id: MutationId
11 table: TableName
12 type: 'INSERT' | 'UPDATE' | 'DELETE'
13 rowId: RowId
14 payload: Record<string, any>
15}
16
17/**
18 * (Auto-generated by Mento)
19 * Wrapper around Drizzle ORM that provides optimistic updates
20 * and offline-first capabilities. Mutations are stored locally
21 * and synced in the background when online.
22 */
23class OptimisticDrizzle {
24 private mutationQueue: OptimisticMutation[]
25 private localDb: IndexedDB // Local storage
26 private syncInProgress: boolean
27
28 // ...
29}
Mento Synced
Dependency Graph
1
Patterns
1
Database ORM singleton
Offline-first mutations
Cache Invalidation
Decisions
1
24-12-2024
We're using Drizzle
04-07-2024
No more client-side data fetching

The Problem

Documentation — no one writes it, everyone needs it.

packages / database / src / db.ts
1/**
2 * {@link https://getmento.dev/my-org/docs/packages/database}
3 *
4 * (Auto-generated by Mento)
5 * Types and implementation for the optimistic mutation system that handles
6 * local-first database operations with eventual consistency.
7 */
8
9interface OptimisticMutation {
10 id: MutationId
11 table: TableName
12 type: 'INSERT' | 'UPDATE' | 'DELETE'
13 rowId: RowId
14 payload: Record<string, any>
15}
16
17/**
18 * (Auto-generated by Mento)
19 * Wrapper around Drizzle ORM that provides optimistic updates
20 * and offline-first capabilities. Mutations are stored locally
21 * and synced in the background when online.
22 */
23class OptimisticDrizzle {
24 private mutationQueue: OptimisticMutation[]
25 private localDb: IndexedDB // Local storage
26 private syncInProgress: boolean
27
28 // ...
29}

Code Guidelines

2 / 4 guidelines fulfilled

1 new suggestion

Error Handling

try-catch blocks

Dependency Injection

Use constructor injection

Input Validation

Validate input with zod

Interface Segregation

Separates interfaces based on client needs

Logging

Implements proper logging mechanisms

Focus on writing great code. Mento automatically captures essential decisions, making them instantly clear to your entire team.

Save precious time

Automate documentation

Focus on writing great code. Mento automatically captures essential decisions, making them instantly clear to your entire team.

packages / database / src / db.ts
1/**
2 * {@link https://getmento.dev/my-org/docs/packages/database}
3 *
4 * (Auto-generated by Mento)
5 * Types and implementation for the optimistic mutation system that handles
6 * local-first database operations with eventual consistency.
7 */
8
9interface OptimisticMutation {
10 id: MutationId
11 table: TableName
12 type: 'INSERT' | 'UPDATE' | 'DELETE'
13 rowId: RowId
14 payload: Record<string, any>
15}
16
17/**
18 * (Auto-generated by Mento)
19 * Wrapper around Drizzle ORM that provides optimistic updates
20 * and offline-first capabilities. Mutations are stored locally
21 * and synced in the background when online.
22 */
23class OptimisticDrizzle {
24 private mutationQueue: OptimisticMutation[]
25 private localDb: IndexedDB // Local storage
26 private syncInProgress: boolean
27
28 // ...
29}
Most relevant: Authentication Flow
Overview of the app's auth process
⌘K
Also relevant: GraphQL vs REST API
Decision log for API design choice
⌘K
Microservices Structure
High-level architecture diagram
⌘K
User Service
Core user management functions
⌘K
Press ↑↓ to navigate, ↵ to select, esc to close

Contextual information

Less searching, more building

Engineers waste 5+ hours per week searching for documentation. Mento surfaces the right context for your code instantly.

Pattern detection

Stop reinventing the wheel

Mento detects similar code patterns as you type and helps create the right abstractions, turning repetitive work into reusable components.

Finally

Turn complexity into clarity — with Mento.

packages / database / src / db.ts
1/**
2 * {@link https://getmento.dev/my-org/docs/packages/database}
3 *
4 * (Auto-generated by Mento)
5 * Types and implementation for the optimistic mutation system that handles
6 * local-first database operations with eventual consistency.
7 */
8
9interface OptimisticMutation {
10 id: MutationId
11 table: TableName
12 type: 'INSERT' | 'UPDATE' | 'DELETE'
13 rowId: RowId
14 payload: Record<string, any>
15}
16
17/**
18 * (Auto-generated by Mento)
19 * Wrapper around Drizzle ORM that provides optimistic updates
20 * and offline-first capabilities. Mutations are stored locally
21 * and synced in the background when online.
22 */
23class OptimisticDrizzle {
24 private mutationQueue: OptimisticMutation[]
25 private localDb: IndexedDB // Local storage
26 private syncInProgress: boolean
27
28 // ...
29}
Mento
Authentication Flow/auth/login.ts
architectureCurrently viewing
State Management/store/index.ts
patternRelated context
API Integration/services/api.ts
architectureRecently viewed
Database Schema/models/user.ts
decisionRelevant to current file

Documentation

Right next to your code

Access high-level documentation directly in your IDE, without breaking your flow. Every architectural decision and pattern, perfectly contextualized to your current task.

Integrations

Sync with your favorite tools

You make an update to your code — Mento updates your documentation. Eliminating manual maintenance of your docs forever.

Clarity

Share the big picture

From high-level patterns to implementation details, understand how decisions flow through your entire codebase. Mento visualizes it for everyone, even non-technical stakeholders.

No Documentation

50% Code Rejected

AI generates inconsistent code

Basic Docs

75% Code Accepted

AI follows basic patterns

Mento Documentation

95% Code Accepted

AI collaborates as team member

AI-first development

Supercharge your AI assistants

Well-documented code provides AI with context about your architecture, best practices, and patterns. This enables AI to write features just like your senior engineers would, eliminating tedious back-and-forth with disconnected AI tools.