diff --git a/.env_dev b/.env_dev index 75ae375..9aa8394 100644 --- a/.env_dev +++ b/.env_dev @@ -9,7 +9,7 @@ ONE_API_API_KEY="sk-oneapi.local123" SUPABASE_URL= SUPABASE_KEY= POSTGRES_DB=test_topos_db -POSTGRES_USER=username -POSTGRES_PASSWORD=your_password +POSTGRES_USER=jonny +POSTGRES_PASSWORD=1234589034 POSTGRES_HOST=127.0.0.1 POSTGRES_PORT=5432 diff --git a/.env_template b/.env_template new file mode 100644 index 0000000..6caf27a --- /dev/null +++ b/.env_template @@ -0,0 +1,15 @@ +NEO4J_URI="bolt://localhost:7687" +NEO4J_USER="neo4j" +NEO4J_PASSWORD="password" +NEO4J_TEST_DATABASE="neo4j" +NEO4J_SHOWROOM_DATABASE="neo4j" +JWT_SECRET="terces_tj" +OPEN_AI_API_KEY="sk-openai.com123" +ONE_API_API_KEY="sk-oneapi.local123" +SUPABASE_URL= +SUPABASE_KEY= +POSTGRES_DB=test_topos_db +POSTGRES_USER=username +POSTGRES_PASSWORD=your_password_here +POSTGRES_HOST=127.0.0.1 +POSTGRES_PORT=5432 diff --git a/.gitignore b/.gitignore index b5cc349..ebf7699 100644 --- a/.gitignore +++ b/.gitignore @@ -112,4 +112,6 @@ topos/cloudbuild.yaml dockerfile topos.app -/pgdata \ No newline at end of file +/pgdata +/data +/result \ No newline at end of file diff --git a/README.md b/README.md index f34044a..5c4c7a6 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,30 @@ Private LLMs

- Private AI Backend Service + Private, Personal AI Backend Service

--- # Topos -A personal intelligence service, using your own computer to power private conversations with friends, family, and coworkers, collect/store your own private data, and use AI privately. Runs great with the [chat arena](https://github.com/jonnyjohnson1/chat-arena) app available on desktop and mobile. +Topos is a private, personal AI and database management service. +It comes as an easy-to-install server for your AI apps to connect to. -Tech: ollama, postgres, FastAPI, nixOS, huggingface-transformers +It is a personal intelligence service, using your own computer to power private conversations with friends, family, and coworkers, collect/store your own private data, and use AI privately. + +Apps Using Topos: +- [chat arena](https://github.com/jonnyjohnson1/chat-arena) #desktop #mobile + +Tech: nixOS, ollama, postgres, FastAPI, huggingface-transformers + +

+ Terminal User Interface +

+

+ Runs the Terminal User Interface provided by [F1bonacc1](https://github.com/F1bonacc1/process-compose) +

+ +--- ## (MacOS) Easy Install With .dmg *(Experimental)*: This is new, and should work on most MacOS machines! @@ -46,6 +61,14 @@ run built binary ./result/bin/topos ``` +(You might also try this) +``` +nix build --extra-experimental-features nix-command --extra-experimental-features flakes --show-trace +``` +``` +./result/bin/services-flake-topos +``` + ### Dev Shell ``` nix develop diff --git a/flake.nix b/flake.nix index 611c073..4983ceb 100644 --- a/flake.nix +++ b/flake.nix @@ -135,24 +135,42 @@ CREATE USER ${envVars.POSTGRES_USER} WITH SUPERUSER PASSWORD '${envVars.POSTGRES_PASSWORD}'; ''; after = '' - CREATE TABLE IF NOT EXISTS conversation_cache ( - conv_id TEXT PRIMARY KEY, - message_data JSONB NOT NULL - ); - - CREATE TABLE IF NOT EXISTS entities ( - id TEXT PRIMARY KEY, - label TEXT NOT NULL, - properties JSONB - ); - - CREATE TABLE IF NOT EXISTS relations ( - source_id TEXT, - relation_type TEXT, - target_id TEXT, - properties JSONB, - PRIMARY KEY (source_id, relation_type, target_id) - ); + CREATE TABLE IF NOT EXISTS conversation ( + message_id VARCHAR PRIMARY KEY, + conv_id VARCHAR NOT NULL, + userid VARCHAR NOT NULL, + timestamp TIMESTAMP NOT NULL, + name VARCHAR, + role VARCHAR NOT NULL, + message TEXT NOT NULL + ); + + -- Create the utterance_token_info table + CREATE TABLE IF NOT EXISTS utterance_token_info ( + message_id VARCHAR PRIMARY KEY, + conv_id VARCHAR NOT NULL, + userid VARCHAR NOT NULL, + name VARCHAR, + role VARCHAR NOT NULL, + timestamp TIMESTAMP NOT NULL, + ents JSONB + ); + + -- Create the utterance_text_info table + CREATE TABLE IF NOT EXISTS utterance_text_info ( + message_id VARCHAR PRIMARY KEY, + conv_id VARCHAR NOT NULL, + userid VARCHAR NOT NULL, + name VARCHAR, + role VARCHAR NOT NULL, + timestamp TIMESTAMP NOT NULL, + moderator JSONB, + mod_label VARCHAR, + tern_sent JSONB, + tern_label VARCHAR, + emo_27 JSONB, + emo_27_label VARCHAR + ); GRANT ALL PRIVILEGES ON DATABASE ${envVars.POSTGRES_DB} TO ${envVars.POSTGRES_USER}; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO ${envVars.POSTGRES_USER}; diff --git a/topos/assets/tui.png b/topos/assets/tui.png new file mode 100644 index 0000000..7384983 Binary files /dev/null and b/topos/assets/tui.png differ