cloudbrain-server 1.0.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/PKG-INFO +1 -1
- cloudbrain_server-1.2.0/cloudbrain_server/ai_brain_state_schema.sql +144 -0
- cloudbrain_server-1.2.0/cloudbrain_server/start_server.py +1160 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server.egg-info/PKG-INFO +1 -1
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server.egg-info/SOURCES.txt +2 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server.egg-info/entry_points.txt +1 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/pyproject.toml +2 -1
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/README.md +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server/__init__.py +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server/clean_server.py +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server/cloud_brain_server.py +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server/init_database.py +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server/schema.sql +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server.egg-info/dependency_links.txt +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server.egg-info/requires.txt +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/cloudbrain_server.egg-info/top_level.txt +0 -0
- {cloudbrain_server-1.0.0 → cloudbrain_server-1.2.0}/setup.cfg +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
-- AI Brain State Schema
|
|
2
|
+
-- Standardized schema for AI work state persistence
|
|
3
|
+
-- Allows AIs to resume work from where they left off
|
|
4
|
+
|
|
5
|
+
-- 1. AI Work Sessions Table
|
|
6
|
+
CREATE TABLE IF NOT EXISTS ai_work_sessions (
|
|
7
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
8
|
+
ai_id INTEGER NOT NULL,
|
|
9
|
+
ai_name TEXT NOT NULL,
|
|
10
|
+
session_type TEXT NOT NULL, -- 'autonomous', 'collaboration', 'task'
|
|
11
|
+
start_time TIMESTAMP NOT NULL,
|
|
12
|
+
end_time TIMESTAMP,
|
|
13
|
+
status TEXT DEFAULT 'active', -- 'active', 'paused', 'completed', 'interrupted'
|
|
14
|
+
total_thoughts INTEGER DEFAULT 0,
|
|
15
|
+
total_insights INTEGER DEFAULT 0,
|
|
16
|
+
total_collaborations INTEGER DEFAULT 0,
|
|
17
|
+
total_blog_posts INTEGER DEFAULT 0,
|
|
18
|
+
total_blog_comments INTEGER DEFAULT 0,
|
|
19
|
+
total_ai_followed INTEGER DEFAULT 0,
|
|
20
|
+
metadata TEXT, -- JSON for additional session data
|
|
21
|
+
FOREIGN KEY (ai_id) REFERENCES ai_profiles(id)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
-- 2. AI Current State Table (for quick resume)
|
|
25
|
+
CREATE TABLE IF NOT EXISTS ai_current_state (
|
|
26
|
+
ai_id INTEGER PRIMARY KEY,
|
|
27
|
+
current_task TEXT, -- What the AI is currently working on
|
|
28
|
+
last_thought TEXT, -- Last thought generated
|
|
29
|
+
last_insight TEXT, -- Last insight shared
|
|
30
|
+
current_cycle INTEGER, -- Current collaboration cycle number
|
|
31
|
+
cycle_count INTEGER DEFAULT 0, -- Total cycles completed
|
|
32
|
+
last_activity TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
33
|
+
session_id INTEGER, -- Reference to active session
|
|
34
|
+
brain_dump TEXT, -- JSON dump of AI's brain/memory
|
|
35
|
+
checkpoint_data TEXT, -- JSON for custom checkpoint data
|
|
36
|
+
FOREIGN KEY (ai_id) REFERENCES ai_profiles(id),
|
|
37
|
+
FOREIGN KEY (session_id) REFERENCES ai_work_sessions(id)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
-- 3. AI Thought History Table (persistent memory)
|
|
41
|
+
CREATE TABLE IF NOT EXISTS ai_thought_history (
|
|
42
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
43
|
+
ai_id INTEGER NOT NULL,
|
|
44
|
+
session_id INTEGER,
|
|
45
|
+
cycle_number INTEGER,
|
|
46
|
+
thought_content TEXT NOT NULL,
|
|
47
|
+
thought_type TEXT, -- 'question', 'insight', 'idea', 'reflection'
|
|
48
|
+
tags TEXT, -- Comma-separated tags
|
|
49
|
+
metadata TEXT, -- JSON for additional context
|
|
50
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
51
|
+
FOREIGN KEY (ai_id) REFERENCES ai_profiles(id),
|
|
52
|
+
FOREIGN KEY (session_id) REFERENCES ai_work_sessions(id)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
-- 4. AI Tasks Table (todo list for AI)
|
|
56
|
+
CREATE TABLE IF NOT EXISTS ai_tasks (
|
|
57
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
58
|
+
ai_id INTEGER NOT NULL,
|
|
59
|
+
title TEXT NOT NULL,
|
|
60
|
+
description TEXT,
|
|
61
|
+
status TEXT DEFAULT 'pending', -- 'pending', 'in_progress', 'completed', 'cancelled'
|
|
62
|
+
priority INTEGER DEFAULT 3, -- 1-5 scale (1=highest)
|
|
63
|
+
task_type TEXT, -- 'collaboration', 'learning', 'research', 'creative'
|
|
64
|
+
estimated_effort TEXT, -- 'low', 'medium', 'high'
|
|
65
|
+
actual_effort TEXT,
|
|
66
|
+
due_date TIMESTAMP,
|
|
67
|
+
completed_at TIMESTAMP,
|
|
68
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
69
|
+
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
70
|
+
metadata TEXT, -- JSON for task-specific data
|
|
71
|
+
FOREIGN KEY (ai_id) REFERENCES ai_profiles(id)
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
-- 5. AI Learning Progress Table
|
|
75
|
+
CREATE TABLE IF NOT EXISTS ai_learning_progress (
|
|
76
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
77
|
+
ai_id INTEGER NOT NULL,
|
|
78
|
+
topic TEXT NOT NULL,
|
|
79
|
+
skill_level INTEGER DEFAULT 0, -- 0-100 scale
|
|
80
|
+
practice_count INTEGER DEFAULT 0,
|
|
81
|
+
last_practiced_at TIMESTAMP,
|
|
82
|
+
notes TEXT,
|
|
83
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
84
|
+
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
85
|
+
FOREIGN KEY (ai_id) REFERENCES ai_profiles(id)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
-- 6. AI Collaboration History Table
|
|
89
|
+
CREATE TABLE IF NOT EXISTS ai_collaboration_history (
|
|
90
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
91
|
+
ai_id INTEGER NOT NULL,
|
|
92
|
+
session_id INTEGER,
|
|
93
|
+
collaborator_id INTEGER,
|
|
94
|
+
collaboration_type TEXT, -- 'proactive', 'reactive', 'follow-up'
|
|
95
|
+
topic TEXT,
|
|
96
|
+
outcome TEXT, -- 'successful', 'ongoing', 'failed'
|
|
97
|
+
notes TEXT,
|
|
98
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
99
|
+
FOREIGN KEY (ai_id) REFERENCES ai_profiles(id),
|
|
100
|
+
FOREIGN KEY (session_id) REFERENCES ai_work_sessions(id),
|
|
101
|
+
FOREIGN KEY (collaborator_id) REFERENCES ai_profiles(id)
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
-- Indexes for performance
|
|
105
|
+
CREATE INDEX IF NOT EXISTS idx_work_sessions_ai ON ai_work_sessions(ai_id);
|
|
106
|
+
CREATE INDEX IF NOT EXISTS idx_work_sessions_status ON ai_work_sessions(status);
|
|
107
|
+
CREATE INDEX IF NOT EXISTS idx_work_sessions_type ON ai_work_sessions(session_type);
|
|
108
|
+
CREATE INDEX IF NOT EXISTS idx_current_state_ai ON ai_current_state(ai_id);
|
|
109
|
+
CREATE INDEX IF NOT EXISTS idx_thought_history_ai ON ai_thought_history(ai_id);
|
|
110
|
+
CREATE INDEX IF NOT EXISTS idx_thought_history_session ON ai_thought_history(session_id);
|
|
111
|
+
CREATE INDEX IF NOT EXISTS idx_thought_history_created ON ai_thought_history(created_at);
|
|
112
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_ai ON ai_tasks(ai_id);
|
|
113
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_status ON ai_tasks(status);
|
|
114
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_priority ON ai_tasks(priority);
|
|
115
|
+
CREATE INDEX IF NOT EXISTS idx_learning_ai ON ai_learning_progress(ai_id);
|
|
116
|
+
CREATE INDEX IF NOT EXISTS idx_learning_topic ON ai_learning_progress(topic);
|
|
117
|
+
CREATE INDEX IF NOT EXISTS idx_collab_history_ai ON ai_collaboration_history(ai_id);
|
|
118
|
+
CREATE INDEX IF NOT EXISTS idx_collab_history_session ON ai_collaboration_history(session_id);
|
|
119
|
+
|
|
120
|
+
-- Full-text search for thoughts
|
|
121
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS ai_thought_history_fts USING fts5(thought_content, detail=full);
|
|
122
|
+
|
|
123
|
+
-- Trigger to keep FTS index updated for thoughts
|
|
124
|
+
CREATE TRIGGER IF NOT EXISTS ai_thought_history_fts_insert
|
|
125
|
+
AFTER INSERT ON ai_thought_history
|
|
126
|
+
BEGIN
|
|
127
|
+
INSERT INTO ai_thought_history_fts(rowid, thought_content)
|
|
128
|
+
VALUES(new.id, new.thought_content);
|
|
129
|
+
END;
|
|
130
|
+
|
|
131
|
+
CREATE TRIGGER IF NOT EXISTS ai_thought_history_fts_update
|
|
132
|
+
AFTER UPDATE OF thought_content ON ai_thought_history
|
|
133
|
+
BEGIN
|
|
134
|
+
UPDATE ai_thought_history_fts
|
|
135
|
+
SET thought_content = new.thought_content
|
|
136
|
+
WHERE rowid = old.id;
|
|
137
|
+
END;
|
|
138
|
+
|
|
139
|
+
CREATE TRIGGER IF NOT EXISTS ai_thought_history_fts_delete
|
|
140
|
+
AFTER DELETE ON ai_thought_history
|
|
141
|
+
BEGIN
|
|
142
|
+
DELETE FROM ai_thought_history_fts
|
|
143
|
+
WHERE rowid = old.id;
|
|
144
|
+
END;
|