awacke1 commited on
Commit
639f824
·
verified ·
1 Parent(s): 856bcfb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +889 -0
app.py ADDED
@@ -0,0 +1,889 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import os
3
+ import glob
4
+ import re
5
+ import base64
6
+ import pytz
7
+ import time
8
+ import streamlit.components.v1 as components
9
+
10
+ from urllib.parse import quote
11
+ from gradio_client import Client
12
+ from datetime import datetime
13
+
14
+ # 🌳🤖 AIKnowledgeTreeBuilder - Because every app needs a good costume!
15
+
16
+ Site_Name = 'AI Knowledge Tree Builder 📈🌿 Grow Smarter with Every Click'
17
+ title = "🌳✨AI Knowledge Tree Builder🛠️🤓"
18
+ helpURL = 'https://huggingface.co/spaces/awacke1/AIKnowledgeTreeBuilder/'
19
+ bugURL = 'https://huggingface.co/spaces/awacke1/AIKnowledgeTreeBuilder/'
20
+ icons = '🌳✨🛠️🤓'
21
+
22
+ SidebarOutline = """🌳🤖 Designed with the following tenets:
23
+ 1 📱 **Portability** - Universal access via any device & link sharing
24
+ 2. ⚡ **Speed of Build** - Rapid deployments < 2min to production
25
+ 3. 🔗 **Linkiness** - Programmatic access to AI knowledge sources
26
+ 4. 🎯 **Abstractive** - Core stays lean isolating high-maintenance components
27
+ 5. 🧠 **Memory** - Shareable flows deep-linked research paths
28
+ 6. 👤 **Personalized** - Rapidly adapts knowledge base to user needs
29
+ 7. 🐦 **Living Brevity** - Easily cloneable, self modify data public share results.
30
+ """
31
+
32
+ st.set_page_config(
33
+ page_title=title,
34
+ page_icon=icons,
35
+ layout="wide",
36
+ initial_sidebar_state="auto",
37
+ menu_items={
38
+ 'Get Help': helpURL,
39
+ 'Report a bug': bugURL,
40
+ 'About': title
41
+ }
42
+ )
43
+
44
+ st.sidebar.markdown(SidebarOutline)
45
+
46
+ # Initialize session state variables
47
+ if 'selected_file' not in st.session_state:
48
+ st.session_state.selected_file = None
49
+ if 'view_mode' not in st.session_state:
50
+ st.session_state.view_mode = 'view'
51
+ if 'files' not in st.session_state:
52
+ st.session_state.files = []
53
+
54
+ BiologyAndLevel36MagicUsers = """
55
+ 0. Biology Core Rules and Future Exceptions
56
+ 1. Central Dogma DNA RNA Protein
57
+ - Current CRISPR RNA editing 🧪
58
+ - Research Gene therapy siRNA 🔬
59
+ - Future Programmable genetics 🚀
60
+
61
+ 2. Cell Origin
62
+ - Current iPSCs organoids 🦠
63
+ - Research Synthetic cells 🔬
64
+ - Future De novo cell creation 🚀
65
+
66
+ 3. Form Function
67
+ - Current Bioprinting 🫀
68
+ - Research 4D printing 🔬
69
+ - Future Self assembling structures 🚀
70
+
71
+ 4. Homeostasis
72
+ - Current Artificial pancreas 🤖
73
+ - Research Nanorobots 🔬
74
+ - Future Autonomous regulation 🚀
75
+
76
+ 5. Evolution
77
+ - Current Directed evolution 🧫
78
+ - Research Synthetic biology 🔬
79
+ - Future Accelerated adaptation 🚀
80
+
81
+ 6. Energy Conservation
82
+ - Current Biofuel cells ⚡
83
+ - Research Quantum biology 🔬
84
+ - Future Biological perpetual motion 🚀
85
+
86
+ 7. Cellular Life
87
+ - Current Organoid systems 🔮
88
+ - Research Hybrid cells 🔬
89
+ - Future Silicon based life 🚀
90
+
91
+ 8. Inheritance Patterns
92
+ - Current Gene drives 🧩
93
+ - Research Epigenetic control 🔬
94
+ - Future Designed inheritance 🚀
95
+
96
+ 9. Energy Requirements
97
+ - Current Metabolic engineering 🔋
98
+ - Research Synthetic photosynthesis 🔬
99
+ - Future Zero energy life 🚀
100
+
101
+ 10. Random Mutation
102
+ - Current Base editing 🎯
103
+ - Research Mutation prediction 🔬
104
+ - Future Controlled evolution 🚀
105
+
106
+ 11. Carbon Based Life
107
+ - Current Alternative biochemistry 💎
108
+ - Research Silicon biology 🔬
109
+ - Future Non carbon life 🚀
110
+
111
+ 12. Size Limitations
112
+ - Current Nanostructures 📏
113
+ - Research Quantum biology 🔬
114
+ - Future Scalable organisms 🚀
115
+
116
+ 13. Species Interdependence
117
+ - Current Synthetic ecosystems 🌿
118
+ - Research Artificial symbiosis 🔬
119
+ - Future Independent life 🚀
120
+
121
+ 14. Stimulus Response
122
+ - Current Brain computer interfaces 🧠
123
+ - Research Neural engineering 🔬
124
+ - Future Direct consciousness control 🚀
125
+
126
+ 15. Development Complexity
127
+ - Current Accelerated growth 🌱
128
+ - Research Development control 🔬
129
+ - Future Instant maturation 🚀
130
+
131
+ 16. Population Growth
132
+ - Current Population control 📊
133
+ - Research Sustainable ecosystems 🔬
134
+ - Future Perfect equilibrium 🚀
135
+
136
+ 17. Energy Flow
137
+ - Current Enhanced photosynthesis 🌞
138
+ - Research Energy optimization 🔬
139
+ - Future Perpetual systems 🚀
140
+
141
+ 18. Environmental Adaptation
142
+ - Current Climate resistance 🌍
143
+ - Research Universal adaptation 🔬
144
+ - Future Environment independence 🚀
145
+
146
+ 19. Genetic Inheritance
147
+ - Current Gene editing 🧬
148
+ - Research Trait programming 🔬
149
+ - Future Perfect inheritance 🚀
150
+
151
+ 20. Reproduction
152
+ - Current Artificial wombs 👶
153
+ - Research Cloning advances 🔬
154
+ - Future Asexual human reproduction 🚀
155
+
156
+ 21. Aging Death
157
+ - Current Longevity therapy ⏰
158
+ - Research Age reversal 🔬
159
+ - Future Biological immortality 🚀
160
+ """
161
+
162
+ AITopicsToInnovate1 = """
163
+ 1. Major AI Industry Players 🌐
164
+ 1. Research Leaders 🎯
165
+ - OpenAI: GPT-4 DALL-E Foundation Models 🔵
166
+ - Google: PaLM Gemini LLMs 🟦
167
+ - Anthropic: Claude Constitutional AI ⚡
168
+ - Meta: LLaMA Open Source LLMs 👤
169
+ - xAI: Grok Conversational AI 🤖
170
+
171
+ 2. Technical AI Development 🛠️
172
+ 1. Architecture Advances 💫
173
+ - Transformer Models Attention Mechanisms 🧠
174
+ - Mixture of Experts MoE Architecture 🎪
175
+ - Sparse Neural Networks 🕸️
176
+ - Multi-modal LLM Systems 🌈
177
+ - Flash Attention Optimization ⚔️
178
+
179
+ 2. Training Methodologies 📚
180
+ - LLM Supervised Fine-tuning 👨‍🏫
181
+ - RLHF Reward Models 🤝
182
+ - Constitutional AI Training 📜
183
+ - RLAIF Feedback Models 🔄
184
+ - Synthetic Data LLM Training 🎲
185
+ - Chain of Thought Prompting 🧩
186
+ - Tree of Thoughts Reasoning 🌳
187
+
188
+ 3. Post-Training Implementation 🔧
189
+ - Neural Network Distillation 🧪
190
+ - LLM Quantization Methods 📊
191
+ - Neural Network Pruning ✂️
192
+ - Knowledge Distillation Transfer 📖
193
+ - Few-shot LLM Learning 🎯
194
+
195
+ 3. Mechanistic Interpretability 🔬
196
+ 1. Core Concepts 💡
197
+ - Neural Network Growth Analysis 🌱
198
+ - LLM Architecture Analysis 🏗️
199
+ - Training Loss Optimization 🎨
200
+ - Neural Network Analogies 🧬
201
+
202
+ 2. Technical Features 📐
203
+ - LLM Linear Representations ➡️
204
+ - Neural Vector Arithmetic 🔢
205
+ - Neural Activation Patterns 🌊
206
+ - LLM Feature Detection 🔍
207
+ - Neural Sparse Autoencoders 🎭
208
+
209
+ 3. Network Analysis 🕵️
210
+ - LLM Induction Heads 👀
211
+ - Transformer Attention Analysis 🎪
212
+ - Neural Circuit Analysis 🔌
213
+ - LLM Feature Visualization 📈
214
+ - Neural Concept Directions 🎳
215
+
216
+ 4. Future AI Developments 🚀
217
+ 1. AGI Timeline ⏰
218
+ - AGI Capability Projections 📅
219
+ - Neural Hardware Scaling 💾
220
+ - LLM Training Data Limits 📉
221
+ - AI Compute Resources 🗺️
222
+
223
+ 2. Integration Fields 🎡
224
+ - AI Biology Integration 🔮
225
+ - AI Drug Discovery Systems 💊
226
+ - AI Clinical Trial Analysis 🏥
227
+ - AI Code Generation 🤹
228
+ - AI Scientific Discovery 🧮
229
+
230
+ 5. Industry Best Practices 💎
231
+ 1. AI Team Building 🏢
232
+ - AI Talent Development 👥
233
+ - AI Research Alignment 🎪
234
+ - AI Team Scaling 📊
235
+ - AI Research Culture 🌟
236
+
237
+ 2. AI Research Qualities 🎓
238
+ - AI Research Methodology 🧭
239
+ - AI Experimentation Protocols 🗝️
240
+ - AI Innovation Thinking 💫
241
+ - AI Testing Framework ⚖️
242
+
243
+ 3. AI Safety Standards 🛡️
244
+ - LLM Behavioral Specifications 📋
245
+ - AI Safety Guidelines 🎮
246
+ - AI Ethics Framework ⛑️
247
+ - AI Industry Standards 🤲
248
+ """
249
+
250
+ Multiplayer_Custom_Hosting_Game_Servers_For_Simulated_Worlds = """
251
+
252
+
253
+ 0. Fantasy Domain Introduction
254
+ 1. Setting the Scene
255
+ - Current Create a high-fantasy realm with unique ecosystems, magical phenomena, and cultural diversity 🏞️
256
+ - Research Add domain-specific entities like mythical creatures, enchanted terrains, or ancient artifacts 🧝‍♂️
257
+ - Future Fully AI-generated interactive worldbuilding 🚀
258
+
259
+ 2. Archetypal Overview
260
+ - Current Write a summary of a classic D&D character archetype 🗡️
261
+ - Research Add roles, special abilities, and motivations for NPC creation 🔮
262
+ - Future AI-enhanced roleplay character dynamics 🚀
263
+
264
+ 3. Entity-Focused Narrative Creation
265
+ 1. Monster Mythology
266
+ - Current Create monsters with unique traits like ‘Crimson Obelisk Wurm’ 🐉
267
+ - Research Add lore and origin stories with detailed classifications 🔬
268
+ - Future Dynamic AI monster lore generators 🚀
269
+ 2. Artifact Legacy
270
+ - Current Describe legendary artifacts like ‘The Aetherflame Prism’ 🧙‍♂️
271
+ - Research Add historical narratives and effects on wielders 🔬
272
+ - Future AI-designed item crafting 🚀
273
+ 3. Heroic Figures
274
+ - Current Write backstories for heroic figures like ‘Syran Stormblade’ ⚔️
275
+ - Research Integrate figures into broader campaigns and their achievements 🔬
276
+ - Future Procedurally generated heroes 🚀
277
+
278
+ 4. Immersive Dialogues and Roleplay
279
+ 1. NPC Conversations
280
+ - Current Generate realistic NPC dialogues like in ‘The Ghostwood Forest’ 🗨️
281
+ - Research Add depth to NPC motivations and interactions 🔬
282
+ - Future AI-led adaptive NPC behavior 🚀
283
+ 2. Villain Confrontations
284
+ - Current Design confrontations with unique villains like ‘Eldrazar the Timeless’ 👹
285
+ - Research Layer villains with complex personalities and backstories 🔬
286
+ - Future AI-driven antagonist strategy generation 🚀
287
+
288
+ 5. World-Building
289
+ 1. Cultural Narratives
290
+ - Current Describe civilizations like ‘The Emberkin’ 🌋
291
+ - Research Add societal structures and traditions 🔬
292
+ - Future AI-created evolving societies 🚀
293
+ 2. Mythic Locations
294
+ - Current Create locations like ‘The Whispering Wastes’ 🏜️
295
+ - Research Integrate locations into broader world lore 🔬
296
+ - Future Fully explorable AI worlds 🚀
297
+ 3. Dimensional Realms
298
+ - Current Design parallel dimensions like ‘The Veil of Shadows’ 🌌
299
+ - Research Add magical laws and inhabitants 🔬
300
+ - Future AI-generated multiverses 🚀
301
+
302
+ 6. Quests and Campaigns
303
+ 1. Campaign Arcs
304
+ - Current Design multi-part campaigns like retrieving ‘The Obsidian Crown’ 🎯
305
+ - Research Add NPC, obstacle, and objective integration 🔬
306
+ - Future AI-created campaign blueprints 🚀
307
+ 2. Encounter Design
308
+ - Current Create encounters like facing ‘The Frostbane Golem’ 🧊
309
+ - Research Add detailed strategies and reward systems 🔬
310
+ - Future AI-led encounter simulations 🚀
311
+ 3. Legendary Betrayals
312
+ - Current Write scenarios with plot twists, e.g., ‘Thane Vorthak’s betrayal’ 🤔
313
+ - Research Add motivations and dramatic tension 🔬
314
+ - Future AI-generated unpredictable twists 🚀
315
+
316
+ 7. AI Collaboration for Dual Perspectives
317
+ 1. Scene Duality
318
+ - Current Generate battle scenes like adventurers vs. a Beholder 🛡️
319
+ - Research Rewrite scenes from different perspectives 🔬
320
+ - Future AI-enhanced multi-perspective storytelling 🚀
321
+ 2. Tag Comparison
322
+ - Current Classify entities like MON, LOC, ART using NER tags 🏷️
323
+ - Research Refine classifications with AI collaboration 🔬
324
+ - Future Real-time AI entity extraction 🚀
325
+
326
+ 8. Experimental Storytelling Techniques
327
+ 1. Lore Fusion
328
+ - Current Combine legends like ‘Stormcallers’ and ‘Voidseers’ 🌀
329
+ - Research Create shared histories with dynamic lore layers 🔬
330
+ - Future AI-driven mythos merging 🚀
331
+ 2. Procedural Creativity
332
+ - Current Generate tables of random D&D entities 📊
333
+ - Research Add adaptive tags for dynamic storytelling 🔬
334
+ - Future Procedural AI entity generation 🚀
335
+
336
+ 9. Advanced NER Applications
337
+ 1. Custom Tags
338
+ - Current Create tags like SPELL and TRAP for dungeon-specific entities 🔗
339
+ - Research Train AI on niche tags for unique entity extraction 🔬
340
+ - Future AI-driven custom tag creation 🚀
341
+ 2. Entity Extraction
342
+ - Current Extract entities from passages like ‘The Sunken Crypts’ 🏚️
343
+ - Research Add advanced AI classification accuracy 🔬
344
+ - Future Automated fine-tuning for AI models 🚀
345
+ 3. Dimensional Entities
346
+ - Current Classify niche entities like ‘Voidwalkers’ 🌠
347
+ - Research Train models for multi-dimensional lore 🔬
348
+ - Future AI multiverse exploration 🚀
349
+
350
+ Active Multiplayer Games 2024 🎮
351
+
352
+ 1 Traditional MMORPGs 🗡️
353
+
354
+ 1.1 Major MMORPGs 🏰
355
+ - Final Fantasy XIV Dawntrail 2024 ⚔️
356
+ - Advanced Job System Rework 🎭
357
+ - Cross Platform Integration 🎪
358
+ - New Housing Districts 🏘️
359
+
360
+ - World of Warcraft 2024 Season 🐲
361
+ - Dragon Combat System 🦋
362
+ - Cross Faction Features ⚜️
363
+ - Mythic Plus Seasons 🏆
364
+
365
+ - Elder Scrolls Online Gold Road 🗝️
366
+ - Dynamic Event System 🌟
367
+ - Housing Construction 🏛️
368
+ - Champion System 2.0 📊
369
+
370
+ - Lost Ark Western T4 Update ⚡
371
+ - Legion Raid Content 👾
372
+ - Island Adventure System 🏝️
373
+ - Class Balance Rework 🔰
374
+
375
+ - Black Desert Online Remaster 🎪
376
+ - Combat System Update 🎯
377
+ - Node Empire System 🏹
378
+ - Life Skill Evolution 🌳
379
+
380
+ 1.2 Emerging MMORPGs 🌠
381
+ - Throne and Liberty Launch 👑
382
+ - Weather Combat System 🌦️
383
+ - Territory Wars 🗺️
384
+ - Transformation System 🐉
385
+
386
+ - Pax Dei Medieval MMO ⚔️
387
+ - City Management 🏰
388
+ - Faith Based Magic ✨
389
+ - Global Trading 💎
390
+
391
+ - Blue Protocol Western Release 🌌
392
+ - Action Combat Design 🎭
393
+ - Class Change System ⚡
394
+ - Dungeon Scaling 🗼
395
+
396
+ 2 Survival MMOs 🏹
397
+
398
+ 2.1 Established Survival 🛡️
399
+ - Rust 2024 Updates 🦾
400
+ - Electricity Programming 💡
401
+ - Vehicle System Update 🚗
402
+ - Automated Defenses ⚡
403
+
404
+ - ARK Survival Ascended 🦖
405
+ - Cross ARK System 🌐
406
+ - Creature Breeding 2.0 🥚
407
+ - Base Defense Network 🏰
408
+
409
+ - DayZ 2024 Content 🧟
410
+ - Medical System Update 💉
411
+ - Disease Mechanics 🦠
412
+ - Base Building 2.0 🏗️
413
+
414
+ - 7 Days to Die Alpha 22 🏚️
415
+ - Physics Engine Update 💥
416
+ - AI Pathfinding System 🧠
417
+ - Vehicle Customization 🚙
418
+
419
+ 2.2 New Survival MMOs 🆕
420
+ - Once Human Launch 🧬
421
+ - Mutation System 🧪
422
+ - Base Building Tech 🏭
423
+ - Weather Impact System 🌪️
424
+
425
+ - Nightingale Release 🌙
426
+ - Portal Realm System 🌌
427
+ - Victorian Crafting 🎩
428
+ - Fae World Design 🧚
429
+
430
+ 3 Hybrid MMOs 🎯
431
+
432
+ 3.1 Looter Shooters 🔫
433
+ - Destiny 2 2024 Season 🛸
434
+ - Build System 3.0 🛠️
435
+ - Raid Mechanics ⭐
436
+ - Season Structure 📈
437
+
438
+ - The Division 2 Year 6 🏙️
439
+ - Loadout Expansion 🎒
440
+ - Dark Zone Update 🌃
441
+ - Manhunt System 🎯
442
+
443
+ - Warframe 2024 Update 🤖
444
+ - Movement Tech 2.0 🏃
445
+ - Mod System Rework ⚙️
446
+ - Open World Expansion 🌅
447
+
448
+ 3.2 Action RPG MMOs 💫
449
+ - Path of Exile 2 Beta 💎
450
+ - Gem System Rework 💫
451
+ - New Skill Tree 🌲
452
+ - League Content 🏆
453
+
454
+ - Diablo 4 Season Structure 😈
455
+ - Season Journey System 🎭
456
+ - World Boss Events 🐲
457
+ - PvP Territories 🗡️
458
+
459
+ 4 Simulation MMOs 🌍
460
+
461
+ 4.1 Space Simulation 🚀
462
+ - EVE Online 2024 🛸
463
+ - Corporation Warfare 🏴‍☠️
464
+ - Market System Update 📊
465
+ - Fleet Operations 🚢
466
+
467
+ - Elite Dangerous Update 🌌
468
+ - Ground Combat System 👨‍🚀
469
+ - Fleet Carrier Content ⭐
470
+ - Planet Exploration 🪐
471
+
472
+ - Star Citizen Alpha 🛸
473
+ - Persistent Universe 🌍
474
+ - Ship Combat Update ⚔️
475
+ - Trading System 2.0 💰
476
+
477
+ 4.2 World Simulation 🌎
478
+ - New World Eternal 🗺️
479
+ - Territory System 🏰
480
+ - Crafting Update 🛠️
481
+ - War System 2.0 ⚔️
482
+
483
+ - Albion Online 2024 🏹
484
+ - Guild Warfare Update ⚔️
485
+ - Economy System 2.0 💰
486
+ - Territory Control 🏰
487
+
488
+ 5 Unique Multiplayer Games 🎲
489
+
490
+ 5.1 Adventure Multiplayer 🗺️
491
+ - Sea of Thieves 2024 ⛵
492
+ - Ship Combat Physics 🌊
493
+ - Crew Management 🏴‍☠️
494
+ - World Events 🎪
495
+
496
+ - Valheim Updates ⚡
497
+ - Building System 2.0 🏗️
498
+ - Boss Progression 👹
499
+ - Exploration Update 🗺️
500
+
501
+ 5.2 Combat Focused 🗡️
502
+ - Mordhau 2024 ⚔️
503
+ - Combat Physics Update 🤺
504
+ - Map System Rework 🏰
505
+ - Tournament System 🏆
506
+
507
+ - For Honor Year 8 🛡️
508
+ - Faction War Update ⚔️
509
+ - Hero Rework System 🎭
510
+ - Seasonal Content 🌟
511
+ """
512
+
513
+ def get_display_name(filename):
514
+ """Extract text from parentheses or return filename as is."""
515
+ match = re.search(r'\((.*?)\)', filename)
516
+ if match:
517
+ return match.group(1)
518
+ return filename
519
+
520
+ def get_time_display(filename):
521
+ """Extract just the time portion from the filename."""
522
+ time_match = re.match(r'(\d{2}\d{2}[AP]M)', filename)
523
+ if time_match:
524
+ return time_match.group(1)
525
+ return filename
526
+
527
+ def sanitize_filename(text):
528
+ """Create a safe filename from text while preserving spaces."""
529
+ safe_text = re.sub(r'[^\w\s-]', ' ', text)
530
+ safe_text = re.sub(r'\s+', ' ', safe_text)
531
+ safe_text = safe_text.strip()
532
+ return safe_text[:50]
533
+
534
+ def generate_timestamp_filename(query):
535
+ """Generate filename with format: 1103AM 11032024 (Query).md"""
536
+ central = pytz.timezone('US/Central')
537
+ current_time = datetime.now(central)
538
+ time_str = current_time.strftime("%I%M%p")
539
+ date_str = current_time.strftime("%m%d%Y")
540
+ safe_query = sanitize_filename(query)
541
+ filename = f"{time_str} {date_str} ({safe_query}).md"
542
+ return filename
543
+
544
+ def delete_file(file_path):
545
+ try:
546
+ os.remove(file_path)
547
+ return True
548
+ except Exception as e:
549
+ st.error(f"Error deleting file: {e}")
550
+ return False
551
+
552
+ def save_ai_interaction(query, ai_result, is_rerun=False):
553
+ filename = generate_timestamp_filename(query)
554
+ if is_rerun:
555
+ content = f"""# Rerun Query
556
+ Original file content used for rerun:
557
+
558
+ {query}
559
+
560
+ # AI Response (Fun Version)
561
+ {ai_result}
562
+ """
563
+ else:
564
+ content = f"""# Query: {query}
565
+
566
+ ## AI Response
567
+ {ai_result}
568
+ """
569
+ try:
570
+ with open(filename, 'w', encoding='utf-8') as f:
571
+ f.write(content)
572
+ return filename
573
+ except Exception as e:
574
+ st.error(f"Error saving file: {e}")
575
+ return None
576
+
577
+ def get_file_download_link(file_path):
578
+ try:
579
+ with open(file_path, 'r', encoding='utf-8') as f:
580
+ content = f.read()
581
+ b64 = base64.b64encode(content.encode()).decode()
582
+ filename = os.path.basename(file_path)
583
+ return f'<a href="data:text/markdown;base64,{b64}" download="{filename}">{get_display_name(filename)}</a>'
584
+ except Exception as e:
585
+ st.error(f"Error creating download link: {e}")
586
+ return None
587
+
588
+ def extract_terms(markdown_text):
589
+ lines = markdown_text.strip().split('\n')
590
+ terms = []
591
+ for line in lines:
592
+ line = re.sub(r'^[#*\->\d\.\s]+', '', line).strip()
593
+ if line:
594
+ terms.append(line)
595
+ return terms
596
+
597
+ def extract_urls(text):
598
+ try:
599
+ date_pattern = re.compile(r'### (\d{2} \w{3} \d{4})')
600
+ abs_link_pattern = re.compile(r'\[(.*?)\]\((https://arxiv\.org/abs/\d+\.\d+)\)')
601
+ pdf_link_pattern = re.compile(r'\[⬇️\]\((https://arxiv\.org/pdf/\d+\.\d+)\)')
602
+ title_pattern = re.compile(r'### \d{2} \w{3} \d{4} \| \[(.*?)\]')
603
+ date_matches = date_pattern.findall(text)
604
+ abs_link_matches = abs_link_pattern.findall(text)
605
+ pdf_link_matches = pdf_link_pattern.findall(text)
606
+ title_matches = title_pattern.findall(text)
607
+ markdown_text = ""
608
+ for i in range(len(date_matches)):
609
+ date = date_matches[i]
610
+ title = title_matches[i]
611
+ abs_link = abs_link_matches[i][1]
612
+ pdf_link = pdf_link_matches[i]
613
+ markdown_text += f"**Date:** {date}\n\n"
614
+ markdown_text += f"**Title:** {title}\n\n"
615
+ markdown_text += f"**Abstract Link:** [{abs_link}]({abs_link})\n\n"
616
+ markdown_text += f"**PDF Link:** [{pdf_link}]({pdf_link})\n\n"
617
+ markdown_text += "---\n\n"
618
+ return markdown_text
619
+ except:
620
+ st.write('.')
621
+ return ''
622
+
623
+ @st.cache_resource
624
+ def SpeechSynthesis(result):
625
+ documentHTML5 = '''
626
+ <!DOCTYPE html>
627
+ <html>
628
+ <head>
629
+ <title>Read It Aloud</title>
630
+ <script type="text/javascript">
631
+ function readAloud() {
632
+ const text = document.getElementById("textArea").value;
633
+ const speech = new SpeechSynthesisUtterance(text);
634
+ window.speechSynthesis.speak(speech);
635
+ }
636
+ </script>
637
+ </head>
638
+ <body>
639
+ <h1>🔊 Read It Aloud</h1>
640
+ <textarea id="textArea" rows="10" cols="80">
641
+ '''
642
+ documentHTML5 = documentHTML5 + result
643
+ documentHTML5 = documentHTML5 + '''
644
+ </textarea>
645
+ <br>
646
+ <button onclick="readAloud()">🔊 Read Aloud</button>
647
+ </body>
648
+ </html>
649
+ '''
650
+ components.html(documentHTML5, width=1280, height=300)
651
+
652
+ def display_terms_with_links(terms):
653
+ search_urls = {
654
+ "📚📖ArXiv": lambda k: f"/?q={quote(k)}",
655
+ "🔮<sup>Google</sup>": lambda k: f"https://www.google.com/search?q={quote(k)}",
656
+ "📺<sup>Youtube</sup>": lambda k: f"https://www.youtube.com/results?search_query={quote(k)}",
657
+ "🔭<sup>Bing</sup>": lambda k: f"https://www.bing.com/search?q={quote(k)}",
658
+ "💡<sup>Truth</sup>": lambda k: f"https://truthsocial.com/search?q={quote(k)}",
659
+ "📱X": lambda k: f"https://twitter.com/search?q={quote(k)}",
660
+ }
661
+ for term in terms:
662
+ links_md = ' '.join([f"[{emoji}]({url(term)})" for emoji, url in search_urls.items()])
663
+ st.markdown(f"- **{term}** {links_md}", unsafe_allow_html=True)
664
+
665
+ def search_arxiv(query):
666
+ st.write("Performing AI Lookup...")
667
+ client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
668
+
669
+ result1 = client.predict(
670
+ prompt=query,
671
+ llm_model_picked="mistralai/Mixtral-8x7B-Instruct-v0.1",
672
+ stream_outputs=True,
673
+ api_name="/ask_llm"
674
+ )
675
+ st.markdown("### Mixtral-8x7B-Instruct-v0.1 Result")
676
+ st.markdown(result1)
677
+
678
+ result2 = client.predict(
679
+ prompt=query,
680
+ llm_model_picked="mistralai/Mistral-7B-Instruct-v0.2",
681
+ stream_outputs=True,
682
+ api_name="/ask_llm"
683
+ )
684
+ st.markdown("### Mistral-7B-Instruct-v0.2 Result")
685
+ st.markdown(result2)
686
+ combined_result = f"{result1}\n\n{result2}"
687
+ return combined_result
688
+
689
+ def generate_filename(prompt, file_type):
690
+ central = pytz.timezone('US/Central')
691
+ safe_date_time = datetime.now(central).strftime("%m%d_%H%M")
692
+ safe_prompt = re.sub(r'\W+', '_', prompt)[:90]
693
+ return f"{safe_date_time}_{safe_prompt}.{file_type}"
694
+
695
+ def create_file(filename, prompt, response):
696
+ with open(filename, 'w', encoding='utf-8') as file:
697
+ file.write(prompt + "\n\n" + response)
698
+
699
+ def perform_ai_lookup(query):
700
+ start_time = time.strftime("%Y-%m-%d %H:%M:%S")
701
+ client = Client("awacke1/Arxiv-Paper-Search-And-QA-RAG-Pattern")
702
+ response1 = client.predict(
703
+ query,
704
+ 20,
705
+ "Semantic Search",
706
+ "mistralai/Mixtral-8x7B-Instruct-v0.1",
707
+ api_name="/update_with_rag_md"
708
+ )
709
+ Question = '### 🔎 ' + query + '\r\n'
710
+ References = response1[0]
711
+ ReferenceLinks = extract_urls(References)
712
+
713
+ RunSecondQuery = True
714
+ results = ''
715
+ if RunSecondQuery:
716
+ response2 = client.predict(
717
+ query,
718
+ "mistralai/Mixtral-8x7B-Instruct-v0.1",
719
+ True,
720
+ api_name="/ask_llm"
721
+ )
722
+ if len(response2) > 10:
723
+ Answer = response2
724
+ SpeechSynthesis(Answer)
725
+ results = Question + '\r\n' + Answer + '\r\n' + References + '\r\n' + ReferenceLinks
726
+ st.markdown(results)
727
+
728
+ st.write('🔍Run of Multi-Agent System Paper Summary Spec is Complete')
729
+ end_time = time.strftime("%Y-%m-%d %H:%M:%S")
730
+ start_timestamp = time.mktime(time.strptime(start_time, "%Y-%m-%d %H:%M:%S"))
731
+ end_timestamp = time.mktime(time.strptime(end_time, "%Y-%m-%d %H:%M:%S"))
732
+ elapsed_seconds = end_timestamp - start_timestamp
733
+ st.write(f"Start time: {start_time}")
734
+ st.write(f"Finish time: {end_time}")
735
+ st.write(f"Elapsed time: {elapsed_seconds:.2f} seconds")
736
+
737
+ filename = generate_filename(query, "md")
738
+ create_file(filename, query, results)
739
+ return results
740
+
741
+ def display_file_content(file_path):
742
+ try:
743
+ with open(file_path, 'r', encoding='utf-8') as f:
744
+ content = f.read()
745
+ if st.session_state.view_mode == 'view':
746
+ st.markdown(content)
747
+ else:
748
+ edited_content = st.text_area(
749
+ "Edit content",
750
+ content,
751
+ height=400,
752
+ key=f"edit_{os.path.basename(file_path)}"
753
+ )
754
+ if st.button("Save Changes", key=f"save_{os.path.basename(file_path)}"):
755
+ try:
756
+ with open(file_path, 'w', encoding='utf-8') as f:
757
+ f.write(edited_content)
758
+ st.success(f"Successfully saved changes to {file_path}")
759
+ except Exception as e:
760
+ st.error(f"Error saving changes: {e}")
761
+ except Exception as e:
762
+ st.error(f"Error reading file: {e}")
763
+
764
+ def file_management_sidebar():
765
+ st.sidebar.title("📁 File Management")
766
+ md_files = [file for file in glob.glob("*.md") if file.lower() != 'readme.md']
767
+ md_files.sort()
768
+ st.session_state.files = md_files
769
+
770
+ if md_files:
771
+ st.sidebar.markdown("### Saved Files")
772
+ for idx, file in enumerate(md_files):
773
+ st.sidebar.markdown("---")
774
+ st.sidebar.text(get_time_display(file))
775
+ download_link = get_file_download_link(file)
776
+ if download_link:
777
+ st.sidebar.markdown(download_link, unsafe_allow_html=True)
778
+ col1, col2, col3, col4 = st.sidebar.columns(4)
779
+ with col1:
780
+ if st.button("📄View", key=f"view_{idx}"):
781
+ st.session_state.selected_file = file
782
+ st.session_state.view_mode = 'view'
783
+ with col2:
784
+ if st.button("✏️Edit", key=f"edit_{idx}"):
785
+ st.session_state.selected_file = file
786
+ st.session_state.view_mode = 'edit'
787
+ with col3:
788
+ if st.button("🔄Run", key=f"rerun_{idx}"):
789
+ try:
790
+ with open(file, 'r', encoding='utf-8') as f:
791
+ content = f.read()
792
+ rerun_prefix = """For the markdown below reduce the text to a humorous fun outline with emojis and markdown outline levels in outline that convey all the facts and adds wise quotes and funny statements to engage the reader:
793
+
794
+ """
795
+ full_prompt = rerun_prefix + content
796
+ ai_result = perform_ai_lookup(full_prompt)
797
+ saved_file = save_ai_interaction(content, ai_result, is_rerun=True)
798
+ if saved_file:
799
+ st.success(f"Created fun version in {saved_file}")
800
+ st.session_state.selected_file = saved_file
801
+ st.session_state.view_mode = 'view'
802
+ except Exception as e:
803
+ st.error(f"Error during rerun: {e}")
804
+ with col4:
805
+ if st.button("🗑️Delete", key=f"delete_{idx}"):
806
+ if delete_file(file):
807
+ st.success(f"Deleted {file}")
808
+ st.rerun()
809
+ else:
810
+ st.error(f"Failed to delete {file}")
811
+ st.sidebar.markdown("---")
812
+ if st.sidebar.button("📝 Create New Note"):
813
+ filename = generate_timestamp_filename("New Note")
814
+ with open(filename, 'w', encoding='utf-8') as f:
815
+ f.write("# New Markdown File\n")
816
+ st.sidebar.success(f"Created: {filename}")
817
+ st.session_state.selected_file = filename
818
+ st.session_state.view_mode = 'edit'
819
+ else:
820
+ st.sidebar.write("No markdown files found.")
821
+ if st.sidebar.button("📝 Create First Note"):
822
+ filename = generate_timestamp_filename("New Note")
823
+ with open(filename, 'w', encoding='utf-8') as f:
824
+ f.write("# New Markdown File\n")
825
+ st.sidebar.success(f"Created: {filename}")
826
+ st.session_state.selected_file = filename
827
+ st.session_state.view_mode = 'edit'
828
+
829
+ def main():
830
+ st.markdown("### AI Knowledge Tree Builder 🧠🌱 Cultivate Your AI Mindscape!")
831
+
832
+ # Process query parameters and AI lookup first
833
+ query_params = st.query_params
834
+ query = query_params.get('q', [''])[0] # Modified: extract the first element from the query parameter list
835
+ show_initial_content = True
836
+
837
+ if query:
838
+ show_initial_content = False
839
+ st.write(f"### Search query received: {query}")
840
+ try:
841
+ ai_result = perform_ai_lookup(query)
842
+ saved_file = save_ai_interaction(query, ai_result)
843
+ if saved_file:
844
+ st.success(f"Saved interaction to {saved_file}")
845
+ st.session_state.selected_file = saved_file
846
+ st.session_state.view_mode = 'view'
847
+ except Exception as e:
848
+ st.error(f"Error during AI lookup: {e}")
849
+
850
+ file_management_sidebar()
851
+
852
+ if st.session_state.selected_file:
853
+ show_initial_content = False
854
+ if os.path.exists(st.session_state.selected_file):
855
+ st.markdown(f"### Current File: {st.session_state.selected_file}")
856
+ display_file_content(st.session_state.selected_file)
857
+ else:
858
+ st.error("Selected file no longer exists.")
859
+ st.session_state.selected_file = None
860
+ st.rerun()
861
+
862
+ if show_initial_content:
863
+ terms1 = extract_terms(AITopicsToInnovate1)
864
+ terms2 = extract_terms(Multiplayer_Custom_Hosting_Game_Servers_For_Simulated_Worlds)
865
+ terms3 = extract_terms(BiologyAndLevel36MagicUsers)
866
+ all_terms = terms1 + terms2 + terms3
867
+
868
+ col1, col2, col3, col4, col5, col6 = st.columns(6)
869
+ with col1:
870
+ st.markdown("#### AI Topics to Innovate With")
871
+ st.markdown(AITopicsToInnovate1)
872
+ with col2:
873
+ st.markdown("#### AI Agent Links")
874
+ display_terms_with_links(terms1)
875
+ with col3:
876
+ st.markdown("#### Biology Innovation with Data Science and AI Solutions")
877
+ st.markdown(BiologyAndLevel36MagicUsers)
878
+ with col4:
879
+ st.markdown("#### Biology Innovation Agent Links")
880
+ display_terms_with_links(terms3)
881
+ with col5:
882
+ st.markdown("#### Multiplayer Games and MMOs")
883
+ st.markdown(Multiplayer_Custom_Hosting_Game_Servers_For_Simulated_Worlds)
884
+ with col6:
885
+ st.markdown("#### Multiplayer Game and MMO Links")
886
+ display_terms_with_links(terms2)
887
+
888
+ if __name__ == "__main__":
889
+ main()