neutrally-web
v1.0.0
Published
Neutrally is a unified AI workspace where conversations and knowledge persist across different AI models and external developer tools.
Readme
Neutrally - AI Workspace MVP
Neutrally is a unified AI workspace where conversations and knowledge persist across different AI models and external developer tools.
Features
- 🤖 Multi-AI Provider Support: Switch seamlessly between OpenAI and Anthropic models mid-conversation
- 💬 Persistent Conversations: All conversations are saved and searchable
- 🧠 Shared Memory: Context and knowledge persist across different AI models
- 🔍 Smart Search: Search through conversation history by title, summary, or keywords
- 🎨 Dark Mode: Toggle between light and dark themes
- 🔐 Secure: API keys stored locally, conversations encrypted
- 🔌 VSCode Integration Ready: Memory API endpoints for external tool integration
Tech Stack
- Frontend: Next.js 14, React 18, TypeScript, TailwindCSS
- Backend: Next.js API Routes, Supabase PostgreSQL
- AI Providers: OpenAI, Anthropic
- Icons: Lucide React
Prerequisites
- Node.js 18+ and npm
- Supabase account and project
- OpenAI API key
- Anthropic API key
Installation
- Clone the repository:
git clone https://github.com/yourusername/neutrally.git
cd neutrally- Install dependencies:
npm install- Set up environment variables:
- Copy
.env.exampleto.env.local - Fill in your Supabase and AI provider credentials:
- Copy
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_keySet up Supabase database:
- Go to your Supabase project SQL editor
- Run the SQL from
supabase_schema.sql
Run the development server:
npm run dev- Open http://localhost:3000 in your browser
Project Structure
neutrally/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ │ ├── chat/ # Chat completion endpoints
│ │ ├── conversations/ # Conversation CRUD endpoints
│ │ └── memory/ # Memory system endpoints
│ ├── chat/ # Chat page
│ ├── settings/ # Settings page
│ └── page.tsx # Home page
├── components/ # React components
│ ├── ui/ # Base UI components
│ ├── layout/ # Layout components
│ └── chat/ # Chat-specific components
├── services/ # Service layer
│ ├── aiService.ts # AI provider management
│ ├── conversationService.ts
│ ├── memoryService.ts
│ └── summaryService.ts
├── lib/ # Libraries and utilities
│ ├── supabase.ts # Supabase client
│ └── aiProvider.ts # AI provider implementations
└── types/ # TypeScript type definitionsAPI Endpoints
Chat
POST /api/chat- Generate AI response
Conversations
GET /api/conversations- Get user's conversationsPOST /api/conversations- Create new conversationDELETE /api/conversations- Delete conversationGET /api/conversations/[id]/messages- Get conversation messages
Memory System (VSCode Integration)
GET /api/memory/search- Search through conversation memoryGET /api/memory/fetch- Fetch specific conversation detailsGET /api/memory/context- Get user context and recent conversationsPOST /api/memory/context- Update user context
Features in Detail
Conversation Summaries
- Automatically generated every 10 messages
- Extracts keywords, topics, and entities
- Updates user's global context
Model Switching
When switching between AI providers mid-conversation:
- Conversation summary is sent as context
- Last 10 messages are included
- User's global context is provided
Performance Optimizations
- Never sends full conversation history to models
- Uses summaries for context
- Limits message history to last 10 messages
- Implements efficient search with database indexes
Development
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run linting
npm run lintDeployment
This project is ready to deploy on Vercel:
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy
Security Notes
- API keys are stored locally in the browser (Settings page)
- Supabase handles authentication and row-level security
- All database queries use prepared statements
- Conversations are isolated per user
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Support
For issues and questions, please open an issue on GitHub.
Built with ❤️ using Next.js and AI
