1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
# Contributing to supermemory
Thank you for your interest in contributing to supermemory! We welcome contributions from developers of all skill levels. This guide will help you get started with contributing to our AI-powered memory layer API.
## 🚀 Quick Start
### Prerequisites
Before you begin, ensure you have the following installed:
- **Bun** (>= 1.2.17) - Our preferred package manager
- **Git** for version control
### Setting Up the Development Environment
1. **Fork and Clone the Repository**
```bash
git clone https://github.com/supermemoryai/supermemory.git
cd supermemory
```
2. **Install Dependencies**
```bash
bun install
```
3. **Set Up Environment Variables**
```bash
# Copy the example environment file
cp .env.example .env.local
# Edit the file with your configuration
# You'll need to add your API keys and database URLs
```
4. **Change proxy for local development**
Add this in your `proxy.ts`(apps/web) before retrieving the cookie (`getSessionCookie(request)`):
```ts
if (url.hostname === "localhost") {
return NextResponse.next();
}
5. **Start the Development Server**
```bash
bun run dev
```
This will start all applications in the monorepo. The web app will be available at `http://localhost:3000`.
## 📁 Project Structure
supermemory is organized as a monorepo using Turbo:
```
supermemory/
├── apps/
│ ├── web/ # Next.js web application
│ ├── browser-extension/ # Browser extension (WXT-based)
│ ├── docs/ # Documentation site
│ └── raycast-extension/ # Raycast extension
├── packages/
│ ├── ui/ # Shared UI components
│ ├── lib/ # Shared utilities and logic
│ ├── hooks/ # Shared React hooks
│ ├── validation/ # Zod schemas and validation
│ ├── ai-sdk/ # AI SDK for memory operations
│ ├── tools/ # Development tools and utilities
│ ├── openai-sdk-python/ # Python SDK for OpenAI integration
│ ├── openai-sdk-ts/ # TypeScript SDK for OpenAI integration
│ ├── eslint-config/ # ESLint configurations
│ └── typescript-config/ # TypeScript configurations
├── turbo.json # Turbo configuration
├── biome.json # Biome configuration
└── package.json # Root package configuration
```
## 🛠️ Development Workflow
### Available Scripts
- `bun run dev` - Start development servers for all apps
- `bun run build` - Build all applications
- `bun run format-lint` - Format and lint code using Biome
- `bun run check-types` - Type check all packages
### Code Quality
We use several tools to maintain code quality:
- **Biome** for linting and formatting
- **TypeScript** for type safety
- **Turbo** for build optimization
Before submitting a PR, ensure your code passes all checks:
```bash
bun run format-lint
bun run check-types
bun run build
```
### Tech Stack
- **Frontend**: Next.js 15, React 19, TypeScript
- **Styling**: Tailwind CSS, Radix UI components
- **State Management**: Zustand, TanStack Query
- **Build Tool**: Turbo (monorepo)
- **Package Manager**: Bun
- **Deployment**: Cloudflare (OpenNext.js)
## 🎯 How to Contribute
### Types of Contributions
We welcome various types of contributions:
- 🐛 **Bug fixes**
- ✨ **New features**
- 🎨 **UI/UX enhancements**
- ⚡ **Performance optimizations**
### Finding Issues to Work On
1. Check our [Issues](https://github.com/supermemoryai/supermemory/issues) page
2. Look for issues labeled `good first issue` for beginners
3. Issues labeled `help wanted` are great for contributors
4. Feel free to propose new features by opening an issue first
### Making Changes
1. **Create a Branch**
```bash
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix
```
2. **Make Your Changes**
- Follow our coding standards (see below)
- Write clear, concise commit messages
- Add tests if applicable
- Update documentation if needed
3. **Test Your Changes**
```bash
bun run dev # Test locally
bun run build # Ensure it builds
bun run format-lint # Check formatting
bun run check-types # Check types
```
## 📝 Coding Standards
### General Guidelines
- Use **TypeScript** for all new code
- Follow the existing code style and patterns
- Write self-documenting code with clear variable names
- Add JSDoc comments for complex functions
- Keep functions small and focused
### Component Guidelines
- Use functional components with hooks
- Prefer composition over inheritance
- Extract reusable logic into custom hooks
- Use proper TypeScript types for props
### File Naming
- Use `kebab-case` for file names
- Use `PascalCase` for component files
- Use `camelCase` for utility functions
### Import Organization
```typescript
// 1. React and Next.js imports
import React from 'react';
import { NextPage } from 'next';
// 2. Third-party libraries
import { clsx } from 'clsx';
import { motion } from 'motion';
// 3. Internal packages
import { Button } from '@repo/ui';
import { useAuth } from '@repo/lib';
// 4. Relative imports
import { Header } from './header';
import { Footer } from './footer';
```
## 🔄 Pull Request Process
### Before Submitting
1. Ensure your branch is up to date with `main`
2. Run all quality checks
3. Test your changes thoroughly
4. Update documentation if needed
### PR Guidelines
1. **Title**: Use a clear, descriptive title
- ✅ `feat: add semantic search to memory graph`
- ✅ `fix: resolve authentication redirect loop`
- ❌ `update stuff`
2. **Description**: Include:
- What changes you made and why
- Screenshots for UI changes
- Any breaking changes
- Related issue numbers
3. **Size**: Keep PRs focused and reasonably sized
- Prefer multiple small PRs over one large PR
- Each PR should address a single concern
### Review Process
1. All PRs require at least one review
2. Address feedback promptly and professionally
3. Be open to suggestions and improvements
4. Maintain a collaborative attitude
## 🐛 Reporting Issues
### Bug Reports
When reporting bugs, please include:
- **Environment**: OS, Node.js version, browser
- **Steps to reproduce** the issue
- **Expected behavior**
- **Actual behavior**
- **Screenshots** if applicable
- **Error messages** or console logs
### Feature Requests
For feature requests, please provide:
- **Problem statement**: What problem does this solve?
- **Proposed solution**: How should it work?
- **Alternatives considered**: Other approaches you've thought of
- **Additional context**: Any relevant information
## 🏗️ Architecture Guidelines
### State Management
- Use **Zustand** for global state
- Use **TanStack Query** for server state
- Keep state as local as possible
- Use proper TypeScript types for state
### API Integration
- Use the existing API client patterns
- Handle loading and error states properly
- Implement proper error boundaries
- Use optimistic updates where appropriate
### Performance
- Use React.memo() for expensive components
- Implement proper loading states
- Optimize images and assets
- Use code splitting where beneficial
## 🤝 Community Guidelines
### Code of Conduct
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Maintain professionalism in all interactions
### Getting Help
- **Discord**: [Join our Discord server](https://supermemory.link/discord)
- **GitHub Discussions**: For questions and ideas
- **Issues**: For bug reports and feature requests
- **Email**: [[email protected]](mailto:[email protected])
## 📄 License
By contributing to supermemory, you agree that your contributions will be licensed under the same license as the project.
## 🙏 Recognition
All contributors will be recognized in our README and release notes. We appreciate every contribution, no matter how small!
---
Thank you for contributing to supermemory! Together, we're building the future of AI-powered knowledge management. 🚀
|