This directory contains comprehensive API documentation for all RecallRift services and components.
- Database Service - IndexedDB/Dexie operations for data persistence
- AI Service - Google Gemini integration for AI features
- Notification Service - In-app notification system
- Memory Components - Memory-related React components
- UI Components - Reusable UI components
- Form Components - Form and input components
- Search & Filter - Search and filtering utilities
- Data Export/Import - Data management operations
- Analytics - Analytics and metrics collection
// Create memory
const memory = await addMemory({
title: "My Memory",
content: "Memory content",
category: "Personal",
tags: ["important"]
});
// Search memories
const results = await searchMemories("search query");
// Update memory
await updateMemory(memory.id, { title: "Updated Title" });// Analyze memory
const analysis = await analyzeMemory(memory);
// Chat with AI
const response = await sendMessage("What did I learn?", memories);
// Generate summary
const summary = await summarizeMemory(memory);// Show notifications
showSuccess("Operation completed!");
showError("Something went wrong");
showWarning("Please confirm this action");All API methods use consistent error handling patterns:
try {
const result = await apiMethod(params);
return result;
} catch (error) {
console.error('API Error:', error);
showError(error.message);
throw error;
}{
success: true,
data: {}, // Response data
message: "Operation completed successfully"
}{
success: false,
error: {
code: "ERROR_CODE",
message: "Human readable error message",
details: {} // Additional error details
}
}- All data is stored locally using IndexedDB
- API keys are stored securely in local settings
- No external authentication required
- Privacy-first approach with local-only data
- AI service implements intelligent rate limiting
- Automatic retry with exponential backoff
- Request queuing for high-volume operations
- Graceful degradation when limits are reached
All APIs include TypeScript definitions for better development experience:
interface Memory {
id?: number;
title: string;
content: string;
category: string;
tags: string[];
isFavorite: boolean;
createdAt: Date;
updatedAt: Date;
aiSummary?: string;
aiTags?: string[];
}
interface AIAnalysis {
summary: string;
suggestedTags: string[];
category: string;
keyTopics: string[];
importance: number;
}All APIs include comprehensive test coverage:
// Example test
describe('Database API', () => {
it('should create and retrieve memory', async () => {
const memory = await addMemory(testMemory);
expect(memory.id).toBeDefined();
const retrieved = await getMemory(memory.id);
expect(retrieved.title).toBe(testMemory.title);
});
});When upgrading to new API versions:
- Check the CHANGELOG for breaking changes
- Update method calls according to new signatures
- Test thoroughly in development environment
- Monitor for deprecation warnings
To contribute to the API documentation:
- Follow the existing format and style
- Include comprehensive examples
- Document all parameters and return values
- Add error scenarios and handling
- Update this index when adding new API docs
For API-related questions:
- Check the documentation first
- Look at example usage in the codebase
- Create an issue on GitHub with specific questions
- Include code examples when asking for help