Commit Graph
9 Commits
Author SHA1 Message Date
marcocosta10000 def4568355 fggfg 2026-10-26 17:06:03 -03:00
marcocosta10000 5697cd0c40 perf(agent): cache scraped pages and retry failed fetches
Adds a disk-backed scrape cache under workspace/web_cache keyed by
the SHA-256 of the URL, honoring WEB_SEARCH_SCRAPE_CACHE_TTL so
repeated lookups within the window skip the network entirely.

Fetches now retry twice with exponential backoff before giving up,
and URLs are screened against SCRAPING_BLOCKED_EXTENSIONS and
SCRAPING_BLOCKED_DOMAINS to avoid downloading binaries or
denylisted hosts.

New scraping knobs (enable flag, max chars, cache TTL, blocklists)
are exposed via .env, alongside a provider switch to stepfun with
the step-3.7-flash default model.
2026-10-26 17:01:50 -03:00
marcocosta10000 723ca1506b feat(agent): scrape linked pages to ground answers in real content
Adds `_fetch_page_content()`, which downloads a URL with a
browser-like User-Agent and uses BeautifulSoup with the lxml
parser to strip scripts, navigation, and other non-content
markup, returning up to 3000 characters of readable text.

The response validator now also compares generated replies
against this scraped text, flagging named entities and claims
that do not appear in the retrieved page content.

Dependencies: adds beautifulsoup4==4.12.3 and pins lxml==5.3.0
for parser compatibility.
2026-10-26 16:48:29 -03:00
marcocosta10000 9eed02645b feat(search): validate responses against web results
Adds a post-generation validation step that checks whether a
search-grounded reply is actually supported by the retrieved
results: it extracts cited URLs from the response and flags
replies that claim to have searched without citing any of the
provided sources, as well as replies containing specific
numbers or dates absent from the results.

Also switches the default model to xiaomi/mimo-v2.6-flash and
documents the anti-hallucination behavior in the README.
2026-10-26 16:35:20 -03:00
marcocosta10000 ac41cc5771 t4rere 2026-10-26 16:19:07 -03:00
marcocosta10000 4f9d83a451 rerere 2026-10-26 16:13:33 -03:00
marcocosta10000 854348ebeb fix(voice): transcribe audio using the user's preferred language
Voice notes were always recognized with a hardcoded English locale,
which broke transcription for non-English speakers. The handler now
maps the profile's `preferred_language` to a BCP-47 code and passes it
to the Google recognizer, falling back to `pt-BR`.

Also neutralizes the persona prompt so it follows the selected
language instead of forcing Brazilian Portuguese and a fixed gender,
and resets the default `preferred_language` to `pt`.
2026-10-26 15:51:52 -03:00
marcocosta10000 d7f252034e feat(i18n): add /lang command for preferred conversation language
Introduce a language selection command backed by a supported-language
table and per-language response instructions. The chosen code is stored
as `preferred_language` in the user profile and injected into the system
prompt so replies follow the selected language, with an `auto` option
for detection.

Also refreshes the agent and user profile timestamps and appends the
latest conversation context entries.
2026-10-26 15:35:23 -03:00
marcocosta10000 79a73f8f2e feat(bot): add /manual and /about commands to help output
Extend the /help message so users can discover the full user manual
with examples and tips via /manual, and view system information,
version, author, and license via /about.

Also includes the generated conversation context snapshot for
2026-10-26 and the recompiled agent bytecode.
2026-10-26 15:19:17 -03:00