File size: 2,566 Bytes
5b12974
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Context Store - External Services Setup

## Required External Services

To deploy Context Store without local dependencies, set up these cloud services:

### 1. PostgreSQL Database

**Recommended: Neon (Free tier available)**
1. Go to https://neon.tech
2. Create account and new project
3. Copy connection string
4. Set `DATABASE_URL` and `DIRECT_URL` to the same value

**Alternative: Supabase**
1. Go to https://supabase.com
2. Create project
3. Get connection string from Settings > Database

### 2. Neo4j Knowledge Graph

**Neo4j Aura (Free tier available)**
1. Go to https://neo4j.com/cloud/aura/
2. Create free account
3. Create database instance
4. Copy connection URI, username, password
5. Set `NEO4J_URI`, `NEO4J_USERNAME`, `NEO4J_PASSWORD`

### 3. Redis Cache

**Recommended: Upstash Redis (Free tier available)**
1. Go to https://upstash.com
2. Create Redis database
3. Copy connection details
4. Set `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD`

**Alternative: Redis Cloud**
1. Go to https://redis.com/redis-enterprise-cloud/
2. Create database
3. Get connection details

### 4. Environment Variables

Create `.env` file with these values:

```env
# PostgreSQL (from Neon/Supabase)
DATABASE_URL=postgresql://username:password@hostname:port/database
DIRECT_URL=postgresql://username:password@hostname:port/database

# Neo4j (from Aura)
NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password

# Redis (from Upstash)
REDIS_HOST=your-redis.upstash.io
REDIS_PORT=6379
REDIS_PASSWORD=your-password

# Required APIs
OPENAI_API_KEY=sk-your-key
TRIGGER_PROJECT_ID=proj_gtuachiolvvekkzclssn
TRIGGER_SECRET_KEY=tr_dev_your-key

# App Security
SESSION_SECRET=your-long-random-string-at-least-32-chars
ENCRYPTION_KEY=your-32-character-encryption-key-here

# HuggingFace Deployment
PORT=7860
NODE_ENV=production
HOST=0.0.0.0
```

### 5. Quick Setup Commands

After setting up external services:

```bash
# Deploy to HuggingFace
git add .
git commit -m "External services configuration"
git push origin main

# Create HuggingFace Space
# 1. Go to https://huggingface.co/spaces
# 2. Click "Create new Space"
# 3. Choose Docker SDK
# 4. Connect your GitHub repo
# 5. Add environment variables in Space settings
```

## Service Costs (Free Tiers)

- **Neon PostgreSQL**: 500MB storage free
- **Neo4j Aura**: 200k nodes + 400k relationships free  
- **Upstash Redis**: 10k commands/day free
- **HuggingFace Spaces**: Free for public spaces
- **Trigger.dev**: 1000 runs/month free

Total: **$0/month** for development usage