6import { Hono } from "npm:hono";
7import { type Memory } from "../shared/types.ts";
8import { createMemory, deleteMemory, getAllMemories, updateMemory } from "./database/queries.ts";
9
10const app = new Hono();
208```
209โโโ backend/
210โ โโโ database/
211โ โ โโโ migrations.ts # Schema definitions
212โ โ โโโ queries.ts # DB query functions
270- Handle API calls properly with proper error catching
271
272### Database Patterns
273- Run migrations on startup or comment out for performance
274- Change table names when modifying schemas rather than altering
158 const colors = {
159 service: 'rgba(34, 197, 94, 0.8)',
160 database: 'rgba(239, 68, 68, 0.8)',
161 frontend: 'rgba(59, 130, 246, 0.8)',
162 api: 'rgba(168, 85, 247, 0.8)',
170 const icons = {
171 service: 'โ๏ธ',
172 database: '๐๏ธ',
173 frontend: '๐ฅ๏ธ',
174 api: '๐',
3interface SimulationEntity {
4 id: string;
5 type: 'user' | 'service' | 'database' | 'network' | 'load_generator';
6 position: { x: number; y: number; z: number };
7 state: Record<string, any>;
622
623 if (metrics.averageLatency > 500) {
624 recommendations.push("Optimize database queries");
625 recommendations.push("Implement caching layer");
626 recommendations.push("Consider CDN for static assets");
640 case 'api':
641 return 'service';
642 case 'database':
643 return 'database';
644 case 'frontend':
645 return 'service';
155
156- Microservices vs monolithic architecture
157- Database design and data flow
158- API design and integration patterns
159- Scalability and performance requirements
16 id: string;
17 name: string;
18 type: 'service' | 'database' | 'frontend' | 'api' | 'worker' | 'simulation';
19 status: 'pending' | 'building' | 'running' | 'error';
20 config: Record<string, any>;
9### ๐ง The Core Brain & Understanding
10- **LLM Integration**: Central intelligence for reasoning, planning, and code generation
11- **Vector Database**: Semantic memory for knowledge storage and retrieval
12
13### ๐ง The Adaptive Foundation
33โ โโโ core/ # Core SOARE engine
34โ โ โโโ brain/ # LLM and reasoning
35โ โ โโโ memory/ # Vector database and storage
36โ โ โโโ orchestrator/ # Dynamic system management
37โ โ โโโ compiler/ # Code generation and optimization
75- โ
Simple simulation capabilities
76- ๐ง Advanced compiler features (planned)
77- ๐ง Full vector database integration (planned)
78- ๐ง Complex real-world system modeling (planned)
79
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { runMigrations, createDefaultAdmin } from "./database/migrations.ts";
4import * as db from "./database/queries.ts";
5import type {
6 Channel,
14const app = new Hono();
15
16// Initialize database on startup
17await runMigrations();
18await createDefaultAdmin();
279 }
280
281 // Save channels to database
282 const channelIds: string[] = [];
283 for (const channel of parseResult.playlist.channels) {
1// Script to set up the telegram_chats table in SQLite
2// Run this script manually to create the database table
3
4export default async function setupTelegramChatDb() {
25 `);
26
27 return "Telegram chat database table created successfully.";
28 } catch (error) {
29 console.error("Error setting up telegram_chats table:", error);
13## Technical Architecture
14
15**โ ๏ธ important caveat: the admin dashboard doesn't have auth! currently it just relies on security by obscurity of people not knowing the url to a private val. this is not very secure. if you fork this project and put sensitive data in a database you should think carefully about how to secure it.**
16
17Stevens has been designed with the utmost simplicity and extensibility, much like a well-organized household. At the heart of his operation lies a single "memories" table - a digital equivalent of a butler's meticulous records. This table serves as the foundation for all of Stevens' operations.
45- `dashboard`: the admin view for showing the memories notebook + visualizing imports
46- `dailyBriefing`: stuff related to sending a daily update via telegram
47- `dbUtils`: little one-off scripts for database stuff
48
49## Hiring your own Stevens
57- For the Google Calendar integration you'll need `GOOGLE_CALENDAR_ACCOUNT_ID` and `GOOGLE_CALENDAR_CALENDAR_ID`. See [these instuctions](https://www.val.town/v/stevekrouse/pipedream) for details.
58
59**important caveat: the admin dashboard doesn't have auth! currently it just relies on security by obscurity of people not knowing the url to a private val. this is not very secure, if you put sensitive data in a database you should think carefully about how to secure it.**
60
61Overall it's a simple enough project that I encourage you to just copy the ideas and run in your own direction rather than try to use it as-is.