Skip to content

Resolve Issue #60 - #61

Merged
EricNGOntos merged 1 commit into
stagingfrom
feat/wuchengke/agentic-budget-tracing
May 13, 2026
Merged

EricNGOntos merged 1 commit into
stagingfrom
feat/wuchengke/agentic-budget-tracing

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Closes #60

This PR addresses the issue of agentic retrieval failing abruptly on complex queries due to token exhaustion. We've implemented the following features:

  1. Agentic Budget Estimation: Added a token budget projection system in attempt_answer before finalizing the context payload. It now projects the required context tokens accurately, ensuring the prompt will fit within limits without silently failing.
  2. Workflow Observability Tracing: Introduced a tracing schema (via Alembic migration) to log workflow state variables such as navigation scope, asset filtering, and failures per step. This allows full visibility into the agent's intermediate decisions.
  3. Improved Path Hydration Selection: Cleaned up the path extraction logic (collect_all_paths) to correctly exclude paths during discovery, preventing duplicate rendering of L3 structural nodes.
  4. Enhanced Error Transparency: Extracted detailed failure reasons when the model returns NOT_FOUND, making it easier for users to diagnose query mismatch.
  5. Contract Tests: Added automated tests for the new budget and answer policy contracts to prevent regressions.

These changes significantly improve the reliability of the system under heavy token loads.

@EricNGOntos EricNGOntos added the agentic-rag-core Core agentic RAG retrieval pipeline label May 13, 2026
@EricNGOntos EricNGOntos self-assigned this May 13, 2026
@EricNGOntos
EricNGOntos merged commit 2fcf129 into staging May 13, 2026
7 checks passed
@EricNGOntos
EricNGOntos deleted the feat/wuchengke/agentic-budget-tracing branch May 13, 2026 19:23
0,
min(100, round(remaining_int * 100 / capacity_int)),
)
except (TypeError, ValueError):
from shared.core.database import get_db_context
from shared.services.retrieval.agentic.budget import BudgetLedger
from shared.services.retrieval.agentic.orchestrator import RetrievalAgent
from shared.services.retrieval.agentic.orchestrator import RetrievalAgent, _load_budget_inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic-rag-core Core agentic RAG retrieval pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants