Skip to content

alexvilelabah/bah-browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

233 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bah

Bah

AI browser β€” type in plain language, and the AI autonomously operates the web for you.
Perplexity Comet style Β· open / source-available Β· by VilelaLab.

🌐 English Β· PortuguΓͺs

Downloads Version

You give natural-language commands ("open gmail and delete the spam") and the AI operates the browser in your place β€” reading the screen, clicking with a real mouse, typing, and going until it's done.

πŸ’Έ Free out of the box β€” no key, no GPU. Chat and image generation work the moment you open it, with no API key. For the full autonomous agent (or more speed), add a cheap key β€” DeepSeek (recommended), Mistral or NVIDIA NIM. Prefer 100% local + offline? Run a model with Ollama.

Electron React TypeScript Vite

Works with
DeepSeek Mistral NVIDIA NIM Ollama

🎬 Demo

Bah in action

▢️ Download the full video β€” the agent searching and operating the web on its own. (the GIF above is a preview; GitHub doesn't play embedded video in the README.)

πŸš€ Quick Start (Plug & Play)

πŸ§‘ I just want to use it (Windows): grab the installer here β†’ the Bah-Setup-*.exe file, double-click and install.

🏠 Want it 100% local & free? No terminal needed. Set up the AI right inside the browser: open the AI panel β†’ 🏠 Local AI β†’ type a model name β†’ Download, and Bah pulls the Ollama model for you. (Prefer the cloud? A cheap DeepSeek key works too β€” and needs no GPU.)

πŸ”„ Auto-updates: after installing, Bah checks for new versions, downloads them in the background and offers "Restart now" to apply β€” no reinstalling.

⚠️ Windows shows a blue "protected your PC" screen (the app isn't code-signed with a paid certificate yet). Click More info β†’ Run anyway β€” normal for new open-source apps. (Later updates install without that warning.)

πŸ‘¨β€πŸ’» I want to hack on the code: clone and run it β€” see Running it below.


What it does

  • Full browser with tabs, navigation, URL bar, dark theme
  • AGENT panel on the side: type a command β†’ the AI decides step by step until it's done
  • Reads the page (DOM, numbered interactive elements, and OCR) and acts through structured tools β€” it doesn't rely on "seeing" the screen
  • AI: works free out of the box (no key) β€” great for chat and image generation. For the full autonomous agent: DeepSeek (cheap, recommended) β€” also Mistral / NVIDIA NIM β€” or Ollama (local/offline)
  • Chat per tab β€” each browser tab keeps its own conversation; the AI remembers each tab separately
  • One-shot skills: open N videos at once, jump to the exact moment a phrase is spoken across several videos, chat about a YouTube video using its transcript, compare prices, fetch news β€” deterministic shortcuts that cost zero tokens
  • UI in English by default, with PortuguΓͺs and EspaΓ±ol available in Settings β€” the AI replies in your chosen language
  • Full adblock (EasyList + EasyPrivacy) with automatic bypass for sites that break (YouTube, Twitch)
  • Safe Browsing (URLhaus malicious-hosts list, updated daily)
  • Real mouse clicks via Chromium sendInputEvent (not synthetic events β€” goes through React, Vue, Angular without being ignored)
  • Modern-site compatibility β€” presents as standard Chrome (Chrome UA, masks navigator.webdriver) so sites don't wrongly block the browser
  • Comet-style visual overlay β€” pulsing border, scan line, click ripple, status label

Stack

Layer Tech
Browser shell Electron 42 + Chromium
UI React 19 + TypeScript + Vite
AI (cloud) DeepSeek (recommended) Β· Mistral Β· NVIDIA NIM Β· free no-key fallback (Pollinations)
AI (local) Ollama
Adblock @ghostery/adblocker-electron
Webview <webview> tag with persistent partition

The agent's ReAct loop (core)

USER β†’ "open gmail and delete the spam"
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  for step in 1..25:                           β”‚
β”‚    1. observePage(webview)                    β”‚
β”‚       β†’ { url, title, interactive_elements }  β”‚
β”‚    2. captureScreenshot()                     β”‚
β”‚    3. AI decides ONE action:                  β”‚
β”‚       { action: { type, ...params } }         β”‚
β”‚    4. execute action via REAL OS input        β”‚
β”‚    5. wait, re-observe, self-evaluate         β”‚
β”‚    6. if action == 'done' β†’ return            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tools the AI can call

Action What it does
click_ref(N) Clicks the element with id N from the observed list
fill_ref(N, value) Fills input id N with value (and verifies it took)
click_text(text) Finds by visible text and clicks
click_at(x, y) Click at exact coordinates (visual fallback)
type(text) / press(key) Type into the focused field / send a key
navigate(url) / scroll(dir) Go to a URL / scroll
new_tab / switch_tab / close_tab Tab management
done(reason, success) End the loop

Clicks happen through webContents.sendInputEvent in the main process β€” a real Chromium mouse event, not a synthetic one, so React/Vue/anti-bot sites respond normally. The AI prefers the DOM-first path (click_ref), falling back to text and then coordinates.


Running it

git clone https://github.com/alexvilelabah/bah-browser.git
cd bah-browser
npm install
npm run build
npm start        # or: npx electron .

Windows shortcut: double-click Abrir-Bah.bat.

Setting up the AI

  1. Open the browser, click the AI button in the address bar.
  2. Gear icon β†’ pick a provider.
  3. Works free already (default): nothing to set up β€” chat and image generation run with no key. For the full agent / more speed: pick DeepSeek, Mistral or NVIDIA NIM and paste that provider's key (DeepSeek's is very cheap). β†’ Save.
  4. Local (optional, free/offline): install Ollama and keep it running (it lives in the tray and serves models at 127.0.0.1:11434). Then download a model from inside Bah (☁️/🏠 β†’ 🏠 Local AI β†’ type a name β†’ Download) or in a terminal (e.g. ollama pull qwen3:14b). Local works offline, but the cloud (DeepSeek) is more reliable.

Safety & limits

The agent runs with full browser privileges, so it's worth being clear about what it does and doesn't do:

βš–οΈ You're in control β€” and responsible. Bah acts in your real session, on your account. Use it within each site's terms and the law. Sensitive actions (paying, buying, deleting, entering card data) always ask for your confirmation first.

πŸ” Audit it yourself. The full threat model, a verify-it-yourself checklist (each protection β†’ the exact file), what leaves your machine, and an honest list of accepted tradeoffs all live in SECURITY.md. A map of the codebase β€” every file, the live agent loop, the build β€” is in ARCHITECTURE.md. The whole of src/ is ~30 files.

  • πŸ”“ It's your real session. The browser uses a persistent partition (persist:browser), so cookies and logins are saved. If you're logged into Gmail in Bah, so is the agent. The AI can access anything you could access manually. Don't log into accounts you wouldn't trust an assistant with.

  • πŸ›‘οΈ Safety brake on sensitive actions. Before paying, buying, deleting, or entering card data, the agent pauses and asks for your confirmation β€” and this works on every path (model clicks, coordinate clicks, Enter on a checkout page, learned shortcuts, and repeated automations). It never does those silently.

  • πŸ›‘ Stop means stop. The β–  Stop button cancels immediately, even mid model-call or mid-loop; a late response won't "resurrect" a cancelled task.

  • 🎯 No fake success. After a fill/type the agent checks the field actually holds the value; if an action had no real effect it switches strategy instead of reporting success.

  • πŸ™‹ Asks for help when blocked. On a CAPTCHA, login wall, or paywall it stops and asks you to step in, then resumes β€” it doesn't flail.

  • πŸ”’ 25-step cap per command. If a task doesn't finish in 25 actions, the agent stops on its own.

  • 🧩 Compatibility, not evasion. We present as standard Chrome (Chrome UA + masking navigator.webdriver) only to avoid being wrongly blocked. We do not break CAPTCHAs, dodge rate-limits, or automate things sites forbid in their terms.

  • πŸ”‘ Google login β€” use the "Sign in to Google" button. Google blocks login inside embedded browsers (Electron/webview). Bah handles it the right way: click πŸ”‘ Sign in to Google β†’ it opens the login in your real Chrome/Edge (where Google trusts it), you sign in, and Bah detects it automatically, imports the session (cookies via CDP) and closes the login window. Do it once and you stay logged in.

  • 🚫 Adblock pauses on known sites. YouTube and Twitch get automatic bypass so their player isn't blocked by anti-adblock. Everywhere else adblock stays on.

Not implemented yet (but would be nice): a "preview the plan, then approve" mode before running, a per-tab sandbox, and click rate-limiting to avoid aggressive bot-like behavior.


Comparison with other agents

Bah Comet Browser-Use
Open source βœ… ❌ βœ…
100% local option (Ollama) βœ… ❌ βœ…
Runs at home βœ… ❌ ❌ (lib only)
Cloud or local AI βœ… ❌ (cloud only) βœ…
Real clicks (not synthetic) βœ… βœ… βœ…
Full UI βœ… βœ… ❌
Adblock + Safe Browsing βœ… βœ… ❌
Confirmation before sensitive actions βœ… ⚠️ ❌

ℹ️ The tested and recommended AI path is DeepSeek (cloud); local (Ollama) also works but is less validated.


License

PolyForm Small Business 1.0.0 β€” see LICENSE.

In short (not legal advice β€” the license text rules):

  • βœ… Free for personal use, study, your own projects, and small businesses (under 100 people and under US$1M revenue last year).
  • βœ… You may modify, improve and redistribute, keeping this license notice.
  • πŸ’Ό Large company / commercial use above that size needs a commercial license β€” reach me at alexmachadovilela@gmail.com.
  • ❌ No warranty. Provided "as is".

Contact

Made with πŸ§‰ by Alex Vilela β€” VilelaLab.

About

Bah - an AI browser (Perplexity Comet-style) by VilelaLab. Type plain-language commands and the agent clicks and types for you. Works free out of the box, or use your own key (DeepSeek/Mistral/NVIDIA) or a local model (Ollama). Electron + React + TypeScript.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors