Commit graph

405 commits

Author SHA1 Message Date
619dc39ddb Update exec_cmd in post_install_cmds_linux to include wait and timeout options 2025-10-24 15:44:50 -03:00
c1778d15ca Enhance package manager to generate and store drive credentials in .env file 2025-10-24 15:39:27 -03:00
a0c367d79b Revert "Implement token-based context usage in chat UI"
This reverts commit 82aa3e8d36.
2025-10-24 11:17:22 -03:00
82aa3e8d36 Implement token-based context usage in chat UI
- Replace simple message count with token-based calculation
- Add token estimation function (4 chars ≈ 1 token)
- Set MAX_TOKENS to 5000 and MIN_DISPLAY_PERCENTAGE to 20
- Update context usage display to show token count percentage
- Track tokens for both user and assistant messages
- Handle server-provided context usage as ratio of MAX_TOKENS
2025-10-23 16:33:23 -03:00
48290c6e3c Add Windows post-install commands for MinIO
Add curl command to download MinIO client for Windows and configure
MinIO client with admin user and policy.

Also add powershell commands to install Valkey on Windows.
2025-10-22 09:25:16 -03:00
fe42812091 Switch cache install to Redis build from source 2025-10-21 22:51:46 -03:00
c242aa010b Enable template bot creation and fix bot schema 2025-10-21 22:43:28 -03:00
9c36aa10fa - More automation from start to web, user sessions. 2025-10-20 23:32:49 -03:00
c595380837 Support legacy bootstrap and update installer 2025-10-20 20:21:31 -03:00
248ad08efc Add new KB and session association tables 2025-10-20 19:49:54 -03:00
de5b651b89 Refactor config loading and DB URL parsing 2025-10-20 16:52:08 -03:00
30b026585d Add include_dir dependency and use it for embedded migrations
Use include_dir to embed migration scripts and load them at runtime.
This change allows for easier management and versioning of migrations.
2025-10-20 09:42:07 -03:00
93dab6f741 Update PostgreSQL installer commands
Add build command before running cargo Update PostgreSQL installation
commands to use relative paths

Update Linux and macOS installation commands to use `chmod +x ./bin/*`
instead of `chmod +x bin/*`
2025-10-20 07:50:51 -03:00
ed93f70f94 Remove tables install from bootstrap
The tables component is now installed by default. The install command no
longer installs it as part of the bootstrap process.
2025-10-20 07:34:06 -03:00
f8d4e8925f Add indicatif for progress bars and enhance bootstrap
----------------------------------------------------------------
2025-10-19 19:28:08 -03:00
fa0fa390bd Add await to bootstrap start_all call
Fixes the asynchronous bootstrap process by properly awaiting the
start_all method, ensuring all services are started before proceeding.
2025-10-19 15:42:13 -03:00
2af3e3a4b8 Add method to start all components
Implement a new method `start_all` in `BootstrapManager` to start all
components using the `PackageManager`.

This method creates a new `PackageManager` instance and uses it to start
each component in a predefined list.

--- Add remove_local for PackageManager

Remove component specific code

The specific code for component 'tables' has been removed from the
`remove_local` method in `PackageManager`.

The method now simply removes the binary directory for the component.

--- Implement start for PackageManager

Add a new method `start` to `PackageManager` to start a component.

This method takes a component name as an argument and uses the
`exec_cmd` for that component to spawn a new process.

If the component is not found, it returns an error.
2025-10-19 15:03:27 -03:00
6f30517526 - Tables is installing. 2025-10-19 14:02:47 -03:00
88ca214366 Add package manager CLI and component system
Implement core package manager with component configuration, installer
logic, OS detection, and a command‑line interface for install, remove,
list, and status operations.
2025-10-19 11:08:35 -03:00
aa69c63cee Refactor bootstrap and package manager, add ureq
- Split package manager into separate modules
- Expose only the installer API
- Simplify BootstrapManager to install components and load config
- Pin ureq to 3.1.2 and add ureq‑proto crate
- Clean up configuration code and remove legacy comments
- Update helper scripts and server start command formatting
2025-10-19 11:08:23 -03:00
e1f9111392 Update password generator to new Rand API
Replace `thread_rng` with `rng` and use `random_range` for character
selection. Rename the `component` argument to `_component` in
`PackageManager::download_binary` to suppress an unused‑parameter
warning.
2025-10-18 22:26:42 -03:00
d970d48aa7 - Postgres updated to 18. 2025-10-18 22:25:59 -03:00
88a52f172e - New bootstrap engine. 2025-10-18 19:08:00 -03:00
d9e0f1f256 - Knowledge management. 2025-10-18 18:20:02 -03:00
a77e0d6aa5 - Added logic to Knowledge management. 2025-10-18 18:19:08 -03:00
27d0349989 - Refactoring bot package. 2025-10-18 12:03:07 -03:00
be1e2575f9 - Refactor in bot package. 2025-10-18 12:01:39 -03:00
79ac6df738 - Added component management. 2025-10-18 09:26:48 -03:00
a716f69702 Add trace logging to AutomationService and increase timeout values in LLM commands 2025-10-17 13:11:49 -03:00
e5a9752caa Enhance bot memory and Redis guards
- Derive bot_id from BOT_GUID env var
- Guard concurrent runs with Redis
- Read CACHE_URL for Redis connection
- Extend bot memory keyword to accept comma as separator
- Increase LLM timeouts to 180s (local and legacy)
- Update templates to use bot memory (GET_BOT_MEMORY/SET_BOT_MEMORY)
- Fix start script path to announcements.gbai
2025-10-16 14:22:28 -03:00
4acb9bb8f5 Migrate automations to param and sqlite
- Rename script_name to param in automation flow and DB schema
- Add BotMemory model and bot_memories table
- Remove script_name field from automation
- Enable sqlite support via rusqlite and related crates (optional)
- Update prompts and queries to use param instead of script_name
- Remove deprecated annoucements GBai templates and align add-req.sh
- Refactor main to initialize automation service and simplify startup
2025-10-16 11:43:02 -03:00
44d4a7b392 Delete dev prompt files and update shared rules
Add rule to shared.md to output only modified files in a .sh script
Remove obsolete dev prompt markdown files
2025-10-16 08:04:06 -03:00
34b4612a93 Remove unnecessary mut from response_channels 2025-10-16 07:56:57 -03:00
1fdf76b530 Refactor TALK keyword to use try_send
Remove unnecessary async spawn in TALK handling and use `try_send` on
the WebSocket channel. Acquire `response_channels` with `try_lock` and
spawn an async task only when falling back to the web adapter. Clean up
debug logs and add missing `env` import. Also delete an extra blank line
in the announcement start script.
2025-10-15 22:39:04 -03:00
648e7f48f9 Refactor LLM parsing and overhaul connection UI
- Strip content up to the “final<|message|>” token in OpenAI responses.
- Replace the text‑based connection‑status indicator with a small
  flashing circle.
- Simplify updateConnectionStatus to take only the status argument.
- Remove special handling of the initial assistant message and
  streamline empty‑state removal.
- Clean up stray blank lines in the announcement template.
2025-10-15 22:24:04 -03:00
ff89298e61 Refactor async GET and LLM, add connection UI
- Execute GET requests in a dedicated thread with its own Tokio runtime,
  add timeout handling and clearer error messages.
- Tighten `is_safe_path` checks and simplify HTTP/S3 logic.
- Change `llm_keyword` to accept `Arc<AppState>`, add prompt builder,
  run LLM generation in an isolated thread with timeout.
- Update keyword registration call in `basic/mod.rs`.
- Convert template script to use `let` declarations and return a
  boolean.
- Introduce connection‑status indicator in the web UI with styles,
  automatic reconnection attempts, and proper WS/WSS handling for voice.
2025-10-15 21:18:01 -03:00
3609bf4eaf Remove unused warn logger import 2025-10-15 19:13:40 -03:00
cfeb024173 Refactor GET keyword with blocking execution
- Replace async task spawning with `block_in_place` to simplify GET
  handling
- Add detailed safety checks for file paths and organization prefixes
- Introduce timeout and keep‑alive settings for HTTP client
- Improve S3 bucket access with existence check, timeouts, and richer
  logging
- Switch tracing logs to debug and add warning logs where appropriate
- Update announcement template to retrieve a PDF, generate a resume via
  LLM, and set context for subsequent queries.
2025-10-15 13:13:27 -03:00
f401c170d4 - GET ketyowrd for buckets. 2025-10-15 12:45:15 -03:00
a293c0e083 - Fix on the web presentation. 2025-10-15 10:37:04 -03:00
f626793d77 Refactor LLM flow, add prompts, fix UI streaming
- Extract LLM generation into `execute_llm_generation` and simplify
  keyword handling.
- Prepend system prompt and session context to LLM prompts in
  `BotOrchestrator`.
- Parse incoming WebSocket messages as JSON and use the `content` field.
- Add async `get_session_context` and stop injecting Redis context into
  conversation history.
- Change default LLM URL to `http://48.217.66.81:8080` throughout the
  project.
- Use the existing DB pool instead of creating a separate custom
  connection.
- Update `start.bas` to call LLM and set a new context string.
- Refactor web client message handling: separate event processing,
  improve streaming logic, reset streaming state on thinking end, and
  remove unused test functions.
2025-10-15 01:14:37 -03:00
e144e013d7 Add async Redis context storage and session fetch
- Use `tokio::spawn` to run Redis SET for `SET_CONTEXT` in a background
  task with detailed tracing.
- Move context retrieval from `BotOrchestrator` to `SessionManager`,
  inserting it as a system message in conversation history.
- Remove redundant Redis fetch logic from `BotOrchestrator`.
- Update `DEV.md` to install `valkey-cli`, reorder cargo tools, and
  adjust apt commands.
- Add a `SET_CONTEXT "azul bolinha"` example to the announcements
  template.
2025-10-15 00:01:48 -03:00
d3c486094f - Fixing ngl param. 2025-10-14 17:02:11 -03:00
552fb56f54 - Fixing parameters for llama.cpp. 2025-10-14 17:00:00 -03:00
277f21ab18 - Fine tunning GTP OSS 20B. 2025-10-14 16:57:50 -03:00
573437cb6f - Database schema added. 2025-10-14 16:34:34 -03:00
37d8fab617 Refactor session handling and auth flow 2025-10-14 14:51:49 -03:00
8f96cd1015 Refactor server code and add auth API fixes 2025-10-14 13:51:27 -03:00
a8f52451c5 New features for start.bas 2025-10-13 18:11:03 -03:00
3aeb3ebc70 - New features for start.bas 2025-10-13 17:43:03 -03:00