File size: 2,517 Bytes
67d20c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Nova Required Services Connection Guide

## Service Matrix
| Service | Port | Purpose | Status |
|---------|------|---------|---------|
| PostgreSQL | 5432 | Structured data | βœ… Operational |
| MongoDB | 27017 | Document storage | βœ… Operational |
| ChromaDB | 8000 | Semantic memory | βœ… Operational |
| Redis (Default) | 6379 | Working memory | βœ… Operational |

## PostgreSQL Connection
```bash
# Connect to PostgreSQL
psql -h localhost -p 5432 -U postgres

# List databases
\l

# Basic SQL
SELECT version();
CREATE DATABASE nova_core;
```

**Python Example:**
```python
import psycopg2

conn = psycopg2.connect(
    host="localhost",
    port=5432,
    user="postgres",
    database="nova_core"
)

cur = conn.cursor()
cur.execute("SELECT NOW();")
print(f"PostgreSQL time: {cur.fetchone()}")
```

## MongoDB Connection
```bash
# Connect to MongoDB
mongosh --port 27017

# Show databases
show dbs

# Use nova database
use nova

# Basic operations
db.sessions.insertOne({session_id: "test", data: {}})
```

**Python Example:**
```python
from pymongo import MongoClient

client = MongoClient("localhost", 27017)
db = client.nova
collection = db.sessions

# Insert document
result = collection.insert_one({
    "session_id": "test_123",
    "timestamp": "2025-08-24",
    "data": {"status": "active"}
})
print(f"Inserted ID: {result.inserted_id}")
```

## ChromaDB Connection
```bash
# Health check
curl http://localhost:8000/api/v1/heartbeat

# List collections
curl http://localhost:8000/api/v1/collections
```

**Python Example:**
```python
import chromadb

client = chromadb.HttpClient(host="localhost", port=8000)

# Create collection
collection = client.create_collection("nova_memories")

# Add embeddings
collection.add(
    documents=["Memory example 1", "Memory example 2"],
    metadatas=[{"type": "fact"}, {"type": "experience"}],
    ids=["id1", "id2"]
)

# Query similar memories
results = collection.query(
    query_texts=["example memory"],
    n_results=2
)
print(f"Similar memories: {results}")
```

## Health Monitoring
```bash
# PostgreSQL
pg_isready -h localhost -p 5432

# MongoDB
mongosh --eval "db.adminCommand('ping')" --quiet

# ChromaDB  
curl -s http://localhost:8000/api/v1/heartbeat | jq .
```

## Security Notes
- ❗ All services bound to localhost only
- ❗ No authentication configured (development)
- ❗ Regular backup procedures needed
- ❗ Monitor disk usage on /data partition
- ❗ Consider adding authentication for production

---
**Last Updated:** September 4, 2025