16 Commits

Author SHA1 Message Date
mpichini1
6bf7c631e4 fix: preserve PageIndex sources in report citations 2026-11-13 19:49:05 +01:00
Alex Castillo
15a6864a64 fix(research): price dated gpt-4o-mini names with the mini rates
get_model_pricing returned the first dict key found inside the model
name, so gpt-4o-mini-2024-07-18 and openai/gpt-4o-mini matched gpt-4o
and were billed at the full model's rates. Pick the longest matching
key instead.
2026-11-03 16:06:19 -05:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bukely_
07abbd7326 feat(pageindex): add OSS knowledge bases and reasoning-based retrieval (#907)
Adds PageIndex OSS as a knowledge-base type and moves PageIndex retrieval from traditional RAG to reasoning-based retrieval: a small workflow-owned agent loop reads the document tree instead of going through the built-in MCP server, which this removes.
2026-08-20 00:35:15 +08:00
Bingxi Zhao (Frank)
97574b5236 fix: three defects on the paths this week's PRs touched
Found by an adversarial pass over the merged changes.

**A tool call could run under another call's name and arguments.**
``_ToolCallBuffers.add`` registered every buffer under the placeholder
item id ``fc_0``, which providers that omit ``item.id`` all share, and
``response.output_item.done`` looked buffers up by that same placeholder.
A ``done`` event for a call that was never announced therefore resolved to
whichever unrelated call last claimed it. Reproduced: a second call to
``list_kb`` was dispatched as ``delete_kb`` carrying the first call's
``{"kb": "secret"}``. The placeholder is a display fallback, not an
identity — never alias it, never look up by it.

**A blocked CDN froze every HTML visualization.** The iframe height
bridge attached its observers on ``DOMContentLoaded``, but ``injectKaTeX``
adds deferred script tags, and deferred scripts must all run before that
event fires. With jsdelivr unreachable the observers never attached and
every visualization sat at its initial height. The bridge is injected just
before ``</body>``, so it can gate on ``document.body`` instead and attach
before the CDN fetch resolves.

**RAG citations dropped their sources.** ``_extract_rag_citation`` was the
only extractor not handed ``tool_metadata``; it re-parsed ``raw_answer``,
which is the prose shown to the model, not JSON. Every RAG pipeline
normalises its retrieval into ``metadata["sources"]`` — already the shape
``_rag_source_payload`` reads — so prefer it and keep the answer parse as
the fallback. This is the user-visible half of #808 that normalising the
payload alone did not restore.

Also hoist the Gemini "minimal, not none" families beside
``_PROVIDER_DEFAULT_OFF_PATTERNS``, whose docstring calls itself the single
source of truth for exactly this knowledge.
2026-08-12 17:28:56 +08:00
Bingxi Zhao (Frank)
eec4134d15 fix: normalize RAG citation payloads (#808) 2026-08-12 16:11:29 +08:00
Santh
5449b2dc05 fix(research): parse first JSON value when adjacent values follow (#680)
extract_json_from_text used a greedy brace match, so {"a":1}{"b":2} returned None.
2026-07-24 16:04:47 +08:00
Bingxi Zhao (Frank)
23ca3024be refactor(agents): rebuild Deep Research / Deep Solve / Question on agentic engine
Replaces three bespoke multi-agent pipelines with orchestrators on top
of a shared agentic-engine primitive set (core/agentic/: labeled_step,
loop, tool_dispatch, usage, client). Each capability now lives in one
pipeline.py file with one pipeline.yaml prompt.

- Deep Research: Rephrase (ask_user loop) -> Decompose (OUTLINE) ->
  Research blocks (THINK/TOOL/APPEND/FINISH per topic, dynamic queue
  preserved) -> Reporting (OUTLINE/INTRO/SECTION/CONCLUSION).
  CitationManager and the dynamic topic queue are kept.
- Deep Solve: Pre-retrieve (KB-only, QUERIES/rag/SUMMARY) -> Plan ->
  per-step THINK/TOOL/FINISH/REPLAN loop with back-edge to Plan ->
  Synthesize. Step FINISH text flows into the next step's context.
- Question: coordinator + pipeline replace generator / idea_agent /
  models, with new history.py and mimic_source.py helpers.

Removed: research/agents/, research/research_pipeline.py,
research/prompts/{en,zh}/*.yaml (legacy multi-agent prompts);
solve/agents/, solve/memory/, solve/utils/, main_solver.py,
session_manager.py, tool_runtime.py and old prompts;
question/agents/{generator,idea_agent}.py, example.py, models.py,
old prompts; api/routers/solve.py (capability owns its own routing).

Adds shared agents/_shared/tool_composition.py for cross-pipeline
tool wiring. Updates deep_research/deep_solve/deep_question
capabilities to dispatch through the new pipelines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:03:44 +08:00
Xinyu Du
1ee7b8204c fix: add deepseek-v4-flash and deepseek-v4-pro to model pricing table
Pricing per DeepSeek API docs (per 1K tokens):
- deepseek-v4-flash: $0.00014 input, $0.00028 output
- deepseek-v4-pro: $0.000435 input, $0.00087 output
2026-05-06 02:18:34 +08:00
Bingxi Zhao (Frank)
824bf778df fix: lint & logging system 2026-05-01 01:39:08 +08:00
Bingxi Zhao (Frank)
77f29cbcc7 fix lint 2026-04-23 19:29:16 +08:00
Bingxi Zhao (Frank)
5960fbc0f7 refactor: remove litellm dependency, align provider architecture
- Replace litellm with native openai + anthropic SDKs across both
  services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
  (anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes #265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml

Made-with: Cursor
2026-04-08 19:59:44 +08:00
kagura-agent
b1623481c2 fix: use parse_json_response for LLM outputs to handle markdown fences
When response_format is unsupported (e.g. deepseek), LLMs return
JSON wrapped in markdown code fences (```json...```). Seven agent
modules used raw json.loads() which fails on fenced responses.

Replace with the existing parse_json_response() utility from
deeptutor/utils/json_parser.py which handles:
- Markdown code block extraction
- json-repair fallback for malformed JSON
- Graceful fallback on parse failure

Affected modules:
- agents/question/agents/idea_agent.py
- agents/solve/agents/planner_agent.py
- agents/guide/agents/design_agent.py
- agents/research/utils/citation_manager.py (3 call sites)
- agents/research/agents/reporting_agent.py
- agents/research/agents/note_agent.py
- agents/research/data_structures.py

Closes #179
2026-04-08 12:11:19 +08:00
Bingxi Zhao (Frank)
c15e22a4b3 chore: stable fix, add tutorbot 2026-03-20 20:27:17 +08:00
Bingxi Zhao (Frank)
f3779138ae fix: remove lightrag and unify llm & search config 2026-03-13 23:48:49 +08:00
Bingxi Zhao (Frank)
9c18bf0705 codebase cleanup and decoupled, introduce cli operation 2026-03-13 20:42:16 +08:00