What is AI Enhancement?
AI Enhancement uses Google Gemini 2.5 Flash to refine your journal entries while preserving your authentic voice. It fixes grammar errors, improves sentence flow, and elevates vocabulary—without changing the meaning or adding fictional events.Why Use AI Enhancement?
Preserve Your Voice
The AI keeps your personal tone and perspective intact—only polishing, never rewriting.
Save Time
Get professional-quality writing in seconds instead of spending minutes editing manually.
Learn & Improve
Compare before/after to see grammar patterns and expand your vocabulary.
Confidence Boost
Share stories publicly knowing they’re polished and error-free.
How to Enhance Your Story
Record or Type Your Story
Start with transcribed voice recording or type directly into the Content field on the Record page.
Click 'Enhance with AI'
Tap the Enhance with AI button below the content area. The button shows a magic wand icon.
Enhancement is disabled if the text field is empty. You must have content first.
Wait for Processing
A loading spinner appears with the message “Polishing story…”. This typically takes 2-5 seconds.The AI processes up to 50,000 characters per request (roughly 8,000 words).
Review Enhanced Text
The enhanced version replaces the original text in the editor. You can:
- Accept it: Proceed to save normally
- Revert it: Click the Revert button (appears after enhancement)
- Edit further: Manually tweak the enhanced text before saving
What the AI Changes (and Doesn’t Change)
✅ What Gets Enhanced
Grammar & Spelling
Grammar & Spelling
- Fixes typos and misspellings
- Corrects verb tense consistency
- Adjusts subject-verb agreement
- Fixes punctuation errors (commas, periods, apostrophes)
Flow & Readability
Flow & Readability
- Breaks up run-on sentences
- Varies sentence structure for rhythm
- Adds transition words for smoother connections
- Reorders clauses for clarity
Vocabulary Elevation
Vocabulary Elevation
- Suggests more precise words (e.g., “walked quickly” → “hurried”)
- Avoids repetition by using synonyms
- Elevates casual phrases to journal-appropriate language
❌ What Stays Unchanged
Meaning
The core message and intent of your story never changes.
Events
No fictional details or events are added—only your truth.
Tone
Your personal voice (humorous, reflective, casual) is preserved.
Names & Dates
Specific people, places, and time references remain intact.
Enhancement Examples
Example 1: Grammar & Flow
Before:“Me and Sarah went to the park yesterday it was really fun we played frisbee and ate sandwiches I wish we could do it more often”After:
“Sarah and I went to the park yesterday. It was really fun—we played frisbee and ate sandwiches. I wish we could do it more often.”Changes: Fixed pronoun order, added punctuation, broke up run-on sentence.
Example 2: Vocabulary Elevation
Before:“I was really sad today because I didn’t get the job. I felt bad about it all day.”After:
“I felt disheartened today after not receiving the job offer. The disappointment lingered throughout the day.”Changes: Elevated casual language while keeping the emotional truth.
Example 3: Preserving Voice
Before:“OMG today was insane! I literally ran into my ex at the coffee shop and we just stared at each other awkwardly for like 10 seconds lol”After:
“Today was surreal! I unexpectedly ran into my ex at the coffee shop, and we just stared at each other awkwardly for about ten seconds.”Changes: Kept the energetic tone but refined internet slang (“OMG” → “surreal”, “lol” removed).
Technical Details
API Endpoint
Limits & Constraints
| Parameter | Limit |
|---|---|
| Max text length | 50,000 characters |
| Rate limit | 10 requests/minute (per user) |
| Model | Google Gemini 2.5 Flash |
| Response time | 2-8 seconds (varies by length) |
The Enhancement Prompt
The AI receives this instruction (from/api/ai/enhance/route.ts:36):
UI States & Feedback
Button States
| State | Visual | Meaning |
|---|---|---|
| Idle | Gray outline button with wand icon | Ready to enhance |
| Disabled | Grayed out, unclickable | No content to enhance OR currently processing |
| Enhancing | Spinner + “Polishing story…” toast | AI is working |
| Revert Available | Amber button with undo icon | Original text can be restored |
Status Badges
While enhancement runs, a badge appears in the Card header:Enhancing… badge with loading spinner shows at the top-right of the Content card.
Revert Functionality
How Revert Works
How Revert Works
When you click Enhance with AI, the original text is saved to
preEnhanceText state. Clicking Revert swaps it back.Limitations:- Only one level of undo (can’t revert twice)
- Revert button disappears after you save the story
- Manual edits after enhancement can’t be undone
/app/record/RecordPageClient.tsx:285-291Error Handling
Common Errors
'No text provided' (400)
'No text provided' (400)
Cause: Empty or whitespace-only text field.Solution: Add content before clicking Enhance.
'Text exceeds maximum length' (400)
'Text exceeds maximum length' (400)
Cause: Story content > 50,000 characters.Solution: Split into multiple shorter entries or trim unnecessary details.
'Failed to enhance text' (500)
'Failed to enhance text' (500)
Cause: Gemini API rate limit, network issue, or server misconfiguration.Solution: Wait 60 seconds and try again. If persistent, check server logs for API key errors.
'Please sign in to enhance' (client-side)
'Please sign in to enhance' (client-side)
Cause: No authentication token available.Solution: Sign in with wallet or Google OAuth before enhancing.
Best Practices
Privacy & Data Handling
Your text is processed securely:
- Sent to Google Gemini API via HTTPS (encrypted in transit)
- Not stored by Google for training (per Gemini API terms)
- Only authenticated users can enhance (Bearer token required)
- No text logging on eStory servers (check
/api/ai/enhance/route.ts:54for console.error on failures only)
Comparison: Manual Editing vs. AI Enhancement
| Aspect | Manual Editing | AI Enhancement |
|---|---|---|
| Time | 5-15 minutes | 3-5 seconds |
| Grammar | Requires knowledge | Automatic |
| Flow | Subjective | Optimized by AI |
| Voice preservation | Full control | 95% preserved |
| Learning opportunity | Limited | High (compare before/after) |
| Best for | Creative control | Speed + polish |
Next Steps
Cognitive Insights
Extract themes and emotions from your enhanced stories
Voice Journaling
Learn how to record stories with AI transcription
Blockchain Storage
Publish your polished stories to permanent IPFS storage