π Making AI Truly Yours - A revolutionary decentralized protocol that gives you complete control over your AI memories and interactions across all platforms.
Synaptic is the world's first Decentralized MCP that solves the fundamental problem of AI memory fragmentation. Instead of your conversations and insights being trapped in isolated AI platforms, Synaptic creates a unified, encrypted, and user-owned memory layer that works across all AI tools.
- π Memory Fragmentation: Your AI conversations are scattered across different platforms
- π€ Data Ownership: You don't control your AI interaction data
- π Privacy Concerns: Your sensitive conversations are stored on corporate servers
- π§ Context Loss: AI tools can't learn from your previous interactions on other platforms
- π° No Incentives: You don't get rewarded for contributing quality data to AI ecosystems
- End-to-end encryption with AES-256-GCM
- Local-first storage - your data stays on your devices
- Zero-knowledge architecture - we can't see your data even if we wanted to
- Granular privacy controls with 4-level privacy system
- Claude (Anthropic) - Full conversation memory extraction
- OpenAI (GPT) - Complete interaction history
- Google Gemini - Native integration support
- Cursor - Development conversation memory
- Windsurf - AI coding assistant integration
- Custom APIs - Extensible adapter framework
- Semantic search with vector embeddings
- Automatic categorization of memories by type and context
- Quality assessment with AI-powered scoring
- Smart context injection for relevant memory retrieval
- Cross-platform memory synthesis
- $SYNA Token - Native ecosystem currency on Solana
- Quality-based mining - earn tokens for valuable contributions
- Decentralized governance - token holders control protocol evolution
graph TB
subgraph "User Interface Layer"
A[Desktop App<br/>Electron]
B[Mobile App<br/>React Native]
C[Browser Extension<br/>Chrome/Firefox]
D[Web Dashboard<br/>React]
end
subgraph "API Gateway Layer"
E[REST API Server<br/>Express.js]
F[WebSocket Server<br/>Socket.io]
G[Rate Limiter<br/>Redis]
H[Authentication<br/>JWT]
end
subgraph "Core Protocol Layer"
I[MemoryConnectionProtocol<br/>Central Orchestrator]
J[CrossMindBridge<br/>AI Integration]
K[PrivacyGuard<br/>Encryption & Privacy]
L[MemoryMiner<br/>Token Mining]
end
subgraph "Storage Layer"
M[MemoryVault<br/>Encrypted Storage]
N[Vector Database<br/>Semantic Search]
O[Cache Layer<br/>Redis/Memory]
P[Backup System<br/>IPFS]
end
subgraph "Blockchain Layer"
Q[Solana Network<br/>$SYNA Token]
R[Smart Contracts<br/>Rust/Anchor]
S[Mining Rewards<br/>Quality Assessment]
end
subgraph "External AI Platforms"
T[Claude API<br/>Anthropic]
U[OpenAI API<br/>GPT Models]
V[Gemini API<br/>Google]
W[Custom APIs<br/>Extensible]
end
A --> E
B --> E
C --> E
D --> E
E --> G
E --> H
E --> F
G --> I
H --> I
F --> I
I --> J
I --> K
I --> L
I --> M
M --> N
M --> O
M --> P
L --> Q
L --> R
L --> S
J --> T
J --> U
J --> V
J --> W
// Location: src/core/MemoryConnectionProtocol.ts (498 lines)
class MemoryConnectionProtocol {
private memoryVault: MemoryVault;
private crossMindBridge: CrossMindBridge;
private privacyGuard: PrivacyGuard;
private memoryMiner: MemoryMiner;
// Core memory operations
async createMemory(content: string, type: MemoryType, category: MemoryCategory): Promise<Memory>
async searchMemories(query: string, options?: SearchOptions): Promise<Memory[]>
async processAIInteraction(platform: AIPlatform, prompt: string, response: AIResponse): Promise<void>
async getMemoryStats(): Promise<MemoryStats>
}// Location: src/storage/MemoryVault.ts (428 lines)
class MemoryVault {
private storage: StorageAdapter;
private encryption: EncryptionService;
private vectorSearch: VectorSearchEngine;
// Storage operations with encryption
async storeMemory(memory: Memory): Promise<string>
async retrieveMemory(id: string): Promise<Memory | null>
async searchSemantic(query: string, options: SearchOptions): Promise<SearchResult[]>
async updateMemory(id: string, updates: Partial<Memory>): Promise<Memory>
}// Location: src/ai/CrossMindBridge.ts (290 lines)
class CrossMindBridge {
private adapters: Map<AIPlatform, AIAdapter>;
// AI platform integration
async processInteraction(platform: AIPlatform, interaction: AIInteraction): Promise<ProcessedInteraction>
async extractMemories(conversation: Conversation): Promise<Memory[]>
async injectContext(platform: AIPlatform, memories: Memory[]): Promise<ContextInjection>
}// Location: src/privacy/PrivacyGuard.ts (258 lines)
class PrivacyGuard {
private encryption: EncryptionService;
private anonymizer: AnonymizationService;
// Privacy protection
async encryptMemory(memory: Memory): Promise<EncryptedMemory>
async anonymizeContent(content: string): Promise<AnonymizedContent>
async detectPII(text: string): Promise<PIIDetectionResult>
}sequenceDiagram
participant U as User
participant API as API Server
participant MCP as MemoryConnectionProtocol
participant PG as PrivacyGuard
participant MV as MemoryVault
participant VS as VectorSearch
participant BC as Blockchain
U->>API: POST /api/memory
API->>API: Validate Request
API->>MCP: createMemory()
MCP->>PG: encryptMemory()
PG->>PG: Detect PII
PG->>PG: Apply Encryption
PG-->>MCP: Encrypted Memory
MCP->>MV: storeMemory()
MV->>VS: Generate Embeddings
VS-->>MV: Vector Embeddings
MV->>MV: Store to Database
MV-->>MCP: Memory ID
MCP->>BC: Mine Quality Score
BC-->>MCP: Mining Result
MCP-->>API: Created Memory
API-->>U: HTTP 201 Response
sequenceDiagram
participant U as User
participant API as API Server
participant MCP as MemoryConnectionProtocol
participant MV as MemoryVault
participant VS as VectorSearch
participant Cache as Cache Layer
U->>API: GET /api/memory/search?query=...
API->>API: Validate & Rate Limit
API->>MCP: searchMemories()
MCP->>Cache: Check Cache
alt Cache Hit
Cache-->>MCP: Cached Results
else Cache Miss
MCP->>MV: searchSemantic()
MV->>VS: Vector Search
VS->>VS: Similarity Calculation
VS-->>MV: Ranked Results
MV->>MV: Apply Privacy Filters
MV-->>MCP: Filtered Results
MCP->>Cache: Store Results
end
MCP-->>API: Search Results
API-->>U: HTTP 200 Response
sequenceDiagram
participant AI as AI Platform
participant CMB as CrossMindBridge
participant MCP as MemoryConnectionProtocol
participant MV as MemoryVault
participant MM as MemoryMiner
participant BC as Blockchain
AI->>CMB: New Interaction
CMB->>CMB: Extract Memories
CMB->>MCP: processAIInteraction()
MCP->>MV: Store Interaction
MCP->>MM: Assess Quality
MM->>MM: AI Quality Analysis
MM->>BC: Submit for Mining
BC->>BC: Validate & Mine
BC-->>MM: Mining Rewards
MM-->>MCP: Quality Score
MCP->>MV: Update Memory Quality
MCP-->>CMB: Processing Complete
CMB-->>AI: Context Injection
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React, Electron, React Native | Multi-platform user interfaces |
| Backend | Node.js, Express.js, TypeScript | API server and business logic |
| Database | SQLite, PostgreSQL, Redis | Data storage and caching |
| Search | Vector embeddings, Semantic search | Intelligent memory retrieval |
| Blockchain | Solana, Rust, Anchor | Token economics and mining |
| AI Integration | OpenAI, Anthropic, Google APIs | Multi-platform AI support |
| Security | AES-256-GCM, JWT, bcrypt | Encryption and authentication |
| DevOps | Docker, Docker Compose | Containerization and deployment |
synaptic/
βββ π src/ # Source code
β βββ π core/ # Core protocol implementation
β β βββ MemoryConnectionProtocol.ts # Central orchestrator (498 lines)
β βββ π storage/ # Storage layer
β β βββ MemoryVault.ts # Encrypted storage (428 lines)
β βββ π ai/ # AI integration
β β βββ CrossMindBridge.ts # AI platform bridge (290 lines)
β βββ π privacy/ # Privacy and security
β β βββ PrivacyGuard.ts # Privacy protection (258 lines)
β βββ π blockchain/ # Blockchain integration
β β βββ MemoryMiner.ts # Token mining (212 lines)
β βββ π api/ # REST API server
β β βββ server.ts # Express server (232 lines)
β β βββ π routes/ # API endpoints
β β β βββ memory.ts # Memory operations (159 lines)
β β β βββ ai.ts # AI interactions (95 lines)
β β β βββ health.ts # Health monitoring (287 lines)
β β β βββ auth.ts # Authentication (70 lines)
β β β βββ blockchain.ts # Blockchain operations (68 lines)
β β βββ π middleware/ # API middleware
β β βββ auth.ts # JWT authentication (146 lines)
β β βββ rateLimiter.ts # Rate limiting (186 lines)
β β βββ validation.ts # Request validation (310 lines)
β βββ π utils/ # Utility modules
β β βββ DatabaseManager.ts # Database abstraction (296 lines)
β β βββ ErrorHandler.ts # Error management (332 lines)
β β βββ PerformanceMonitor.ts # Performance tracking (317 lines)
β β βββ CacheManager.ts # Caching system (395 lines)
β β βββ ConfigManager.ts # Configuration (347 lines)
β β βββ Logger.ts # Logging system (104 lines)
β β βββ Validator.ts # Input validation (172 lines)
β β βββ Encryption.ts # Encryption utilities (121 lines)
β βββ π types/ # TypeScript definitions
β β βββ index.ts # Type definitions (408 lines)
β βββ π config/ # Configuration files
β βββ π scripts/ # Setup and utility scripts
β β βββ setup.ts # Automated setup (426 lines)
β βββ π examples/ # Usage examples
β β βββ basic-usage.ts # Comprehensive examples (424 lines)
β βββ index.ts # Main entry point (119 lines)
βββ π apps/ # Multi-platform applications
β βββ π desktop/ # Electron desktop app
β βββ π mobile/ # React Native mobile app
β βββ π extension/ # Browser extension
βββ π contracts/ # Solana smart contracts
βββ π tests/ # Test suite
βββ π docs/ # Documentation
βββ π config/ # Environment configurations
βββ π³ Dockerfile # Container configuration
βββ π³ docker-compose.yml # Development stack
βββ π¦ package.json # Dependencies and scripts
βββ π§ tsconfig.json # TypeScript configuration
βββ π§ .eslintrc.js # Code quality rules
βββ π§ .prettierrc # Code formatting
βββ π README.md # This documentation
// src/storage/MemoryVault.ts
class MemoryVault {
async storeMemory(memory: Memory): Promise<string> {
// 1. Encrypt sensitive content
const encryptedContent = await this.encryption.encrypt(memory.content);
// 2. Generate vector embeddings for search
const embeddings = await this.vectorSearch.generateEmbeddings(memory.content);
// 3. Store in database with metadata
const storedMemory = {
...memory,
content: encryptedContent,
embeddings,
createdAt: new Date(),
updatedAt: new Date()
};
return await this.storage.save(storedMemory);
}
}// Vector-based semantic search
async searchSemantic(query: string, options: SearchOptions): Promise<SearchResult[]> {
// 1. Generate query embeddings
const queryEmbeddings = await this.vectorSearch.generateEmbeddings(query);
// 2. Calculate similarity scores
const similarities = await this.vectorSearch.findSimilar(
queryEmbeddings,
options.limit || 10,
options.minSimilarity || 0.7
);
// 3. Apply privacy filters
const filteredResults = similarities.filter(result =>
this.privacyGuard.canAccess(result.memory, options.userId)
);
return filteredResults;
}// src/ai/CrossMindBridge.ts
class CrossMindBridge {
async processInteraction(platform: AIPlatform, interaction: AIInteraction): Promise<void> {
// 1. Get platform-specific adapter
const adapter = this.adapters.get(platform);
// 2. Extract memories from conversation
const memories = await adapter.extractMemories(interaction);
// 3. Store memories with quality assessment
for (const memory of memories) {
const qualityScore = await this.assessQuality(memory);
await this.memoryVault.storeMemory({
...memory,
qualityScore,
platform,
sessionId: interaction.sessionId
});
}
// 4. Trigger mining process
await this.memoryMiner.processNewMemories(memories);
}
}// src/privacy/PrivacyGuard.ts
class PrivacyGuard {
async encryptMemory(memory: Memory): Promise<EncryptedMemory> {
// 1. Detect and mask PII
const piiDetection = await this.detectPII(memory.content);
const maskedContent = this.maskPII(memory.content, piiDetection);
// 2. Apply encryption based on privacy level
const encryptionKey = this.generateKey(memory.privacyLevel);
const encryptedContent = await this.encryption.encrypt(maskedContent, encryptionKey);
// 3. Store encryption metadata
return {
...memory,
content: encryptedContent,
encryptionMetadata: {
algorithm: 'AES-256-GCM',
keyId: encryptionKey.id,
piiMasked: piiDetection.found
}
};
}
}POST /api/memory # Create new memory
GET /api/memory/:id # Get memory by ID
PUT /api/memory/:id # Update memory
DELETE /api/memory/:id # Delete memory
GET /api/memory/search # Search memories
GET /api/memory/stats # Get memory statisticsPOST /api/ai/interaction # Process AI interaction
GET /api/ai/context # Get AI context
POST /api/ai/inject # Inject memory context
GET /api/ai/platforms # List supported platformsPOST /api/auth/register # Register new user
POST /api/auth/login # User login
POST /api/auth/refresh # Refresh token
GET /api/auth/profile # Get user profileGET /api/blockchain/balance # Get token balance
POST /api/blockchain/mine # Start mining process
GET /api/blockchain/rewards # Get mining rewards
GET /api/blockchain/stats # Get blockchain statsGET /health # Basic health check
GET /health/detailed # Detailed system health
GET /health/metrics # Performance metrics
GET /health/errors # Error statisticscurl -X POST http://localhost:3000/api/memory \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"content": "TypeScript provides static typing for JavaScript",
"type": "knowledge",
"category": "technical",
"tags": ["typescript", "programming", "javascript"],
"privacyLevel": 1
}'Response:
{
"success": true,
"data": {
"id": "mem_1234567890",
"content": "TypeScript provides static typing for JavaScript",
"type": "knowledge",
"category": "technical",
"qualityScore": 0.85,
"tags": ["typescript", "programming", "javascript"],
"privacyLevel": 1,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}curl "http://localhost:3000/api/memory/search?query=typescript&limit=5&minQuality=0.7" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Response:
{
"success": true,
"data": {
"results": [
{
"id": "mem_1234567890",
"content": "TypeScript provides static typing for JavaScript",
"similarity": 0.92,
"qualityScore": 0.85,
"type": "knowledge",
"category": "technical"
}
],
"total": 1,
"query": "typescript",
"executionTime": "45ms"
}
}- Node.js 18.0.0 or higher
- npm 9.0.0 or higher
- Git for cloning the repository
- Docker (optional, for containerized deployment)
-
Clone the repository
git clone https://github.com/Synaptic-MCP/Synaptic.git cd Synaptic -
Install dependencies
npm install
-
Configure environment
cp env.example .env # Edit .env with your configuration -
Run automated setup
npm run setup:dev
-
Start development server
npm run dev
The API server will be available at http://localhost:3000
-
Using Docker Compose (Full Stack)
docker-compose up -d
-
Using Docker directly
docker build -t synaptic . docker run -p 3000:3000 synaptic
-
Health Check
curl http://localhost:3000/health
-
Run Examples
npm run examples
-
API Documentation Visit
http://localhost:3000/api/docs
import Synaptic, { MemoryType, MemoryCategory, PrivacyLevel } from 'synaptic';
// Initialize Synaptic
const synaptic = new Synaptic({
server: { host: 'localhost', port: 3000 },
storage: { path: './my-memories.db' },
ai: { defaultProvider: 'openai' }
});
// Start the system
await synaptic.start();
// Create a memory
const memory = await synaptic.getProtocol().createMemory(
'React hooks simplify state management in functional components',
MemoryType.KNOWLEDGE,
MemoryCategory.TECHNICAL,
{
tags: ['react', 'hooks', 'javascript'],
privacyLevel: PrivacyLevel.PUBLIC
}
);
// Search memories
const results = await synaptic.getProtocol().searchMemories(
'react state management',
{ limit: 10, minQuality: 0.7 }
);
// Process AI interaction
await synaptic.getProtocol().processAIInteraction(
'claude',
'How do React hooks work?',
'React hooks are functions that let you use state and lifecycle features...',
'session_123'
);
// Get memory statistics
const stats = await synaptic.getProtocol().getMemoryStats();
console.log(`Total memories: ${stats.totalMemories}`);# Create a memory
curl -X POST http://localhost:3000/api/memory \
-H "Content-Type: application/json" \
-d '{
"content": "Machine learning models require quality training data",
"type": "knowledge",
"category": "technical",
"tags": ["ml", "ai", "data"]
}'
# Search memories
curl "http://localhost:3000/api/memory/search?query=machine%20learning&limit=5"
# Get system health
curl http://localhost:3000/health/detailed
# Get performance metrics
curl http://localhost:3000/health/metrics# Development
npm run dev # Start development server
npm run build # Build for production
npm run test # Run test suite
npm run test:watch # Run tests in watch mode
# Code Quality
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run format # Format code with Prettier
# Setup & Deployment
npm run setup:dev # Development setup
npm run setup:prod # Production setup
npm run docker:build # Build Docker image
npm run docker:run # Run Docker container
# Examples & Documentation
npm run examples # Run usage examples
npm run docs # Generate documentation
npm run health # Check server health# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm test -- --testNamePattern="MemoryVault"
# Run tests in watch mode
npm run test:watch# Check system health
npm run health
# View performance metrics
curl http://localhost:3000/health/metrics
# Check error statistics
curl http://localhost:3000/health/errors
# View logs
docker-compose logs -f synaptic-
Build production image
docker build -t synaptic:latest . -
Run with production configuration
docker run -d \ --name synaptic \ -p 3000:3000 \ -e NODE_ENV=production \ -e DATABASE_URL=your_database_url \ -v /path/to/data:/app/data \ synaptic:latest
-
Using Docker Compose
docker-compose -f docker-compose.prod.yml up -d
# Build and push to ECR
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin your-account.dkr.ecr.us-east-1.amazonaws.com
docker build -t synaptic .
docker tag synaptic:latest your-account.dkr.ecr.us-east-1.amazonaws.com/synaptic:latest
docker push your-account.dkr.ecr.us-east-1.amazonaws.com/synaptic:latestapiVersion: apps/v1
kind: Deployment
metadata:
name: synaptic
spec:
replicas: 3
selector:
matchLabels:
app: synaptic
template:
metadata:
labels:
app: synaptic
spec:
containers:
- name: synaptic
image: synaptic:latest
ports:
- containerPort: 3000
env:
- name: NODE_ENV
value: "production"
livenessProbe:
httpGet:
path: /health/live
port: 3000
readinessProbe:
httpGet:
path: /health/ready
port: 3000- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Run tests and linting
npm run check
- Commit your changes
git commit -m "feat: add amazing feature" - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
- TypeScript for all source code
- ESLint for code quality
- Prettier for code formatting
- Jest for testing
- Conventional Commits for commit messages
- Unit tests for all core functionality
- Integration tests for API endpoints
- End-to-end tests for critical user flows
- Minimum 80% code coverage
- Memory Operations: Create, Read, Update, Delete performance
- Search Performance: Semantic search response times
- API Response Times: 95th percentile under 200ms
- Error Rates: Less than 0.1% error rate
- Uptime: 99.9% availability target
# System health
GET /health
# Detailed health with component status
GET /health/detailed
# Performance metrics
GET /health/metrics
# Error statistics
GET /health/errors
# System information
GET /health/system- Caching: Multi-level caching with Redis
- Database Indexing: Optimized database queries
- Connection Pooling: Efficient database connections
- Rate Limiting: API protection and fair usage
- Compression: Response compression for faster transfers
- End-to-end Encryption: AES-256-GCM encryption
- JWT Authentication: Secure token-based auth
- Rate Limiting: Protection against abuse
- Input Validation: Comprehensive request validation
- PII Detection: Automatic sensitive data detection
- Privacy Levels: Granular privacy controls
- Regular security audits
- Dependency vulnerability scanning
- Secure coding practices
- Data minimization principles
- Privacy by design architecture
- Website: https://synapticmcp.xyz
- Twitter: @Synap_tic
- GitHub: @https://github.com/Synaptic-MCP/Synaptic
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for GPT API integration
- Anthropic for Claude API support
- Google for Gemini API access
- Solana Foundation for blockchain infrastructure
- Open Source Community for amazing tools and libraries
π§ Making AI Truly Yours
Built with β€οΈ by the Synaptic Team
Website β’ Documentation β’ Twitter
