Skip to content

feat: bootstrap RAG knowledge base and add think-stage intent eval suite#1496

Open
YuZhangLarry wants to merge 1 commit into
apache:aifrom
YuZhangLarry:ai
Open

feat: bootstrap RAG knowledge base and add think-stage intent eval suite#1496
YuZhangLarry wants to merge 1 commit into
apache:aifrom
YuZhangLarry:ai

Conversation

@YuZhangLarry

Copy link
Copy Markdown
  • RAG seeding (ai/component/rag/): bundled seed docs (seeds/*.md — Dubbo
    overview, configuration, registry, traffic governance, Dubbo Admin) are
    embedded via //go:embed and indexed at startup, so a fresh deployment can
    answer documentation-grade questions out of the box. Indexing is best-effort
    and idempotent (dedup by content hash) and batched to the embedding backend's
    per-request input limit; a missing embedder key degrades gracefully instead of
    failing startup, and reranking falls back to raw vector results when no rerank
    key is configured.
  • ReAct think-stage tuning (ai/component/agent/, ai/prompts/agentThink.txt):
    the think stage now prefers answering directly (suggested_tools: []) and no
    longer confuses objective documentation lookups (config keys, defaults,
    required addresses) with memory search mid-conversation. Adds a ThinkOnce
    entry point so the stage can be evaluated in isolation.
  • Intent-classification eval suite (ai/test/e2e/):
    TestThinkClassificationIsolated runs each documentation question in a fresh
    session (no multi-turn bias) and repeats it to surface nondeterminism as a
    distribution, asserting a stable DOCUMENTATION_QUERY classification routed to
    query_knowledge_base; TestMultiTurnConversation exercises the full
    think→act→observe loop end to end.

Task A — seed data: bundle 5 curated Dubbo/Dubbo-Admin knowledge docs
(component/rag/seeds/*.md), embed them via //go:embed, and index on
startup (best-effort, batched ≤10 to respect the dashscope embedding
per-request cap). Adds seed.enabled config + schema; fixes cmd/index.go
to target the default index the runtime retriever reads from.

Task B — call timing: rewrite agentThink prompt to answer directly by
default and only suggest query_knowledge_base for version-sensitive /
precise-fact lookups. Fix think→act type assertion (ParseThinkOutput
returns a pointer) so the think stage's no-tool decision is honored —
without this the prompt change had no effect. Lower max_iterations
10→3 and timeout 60→30 for faster fallback.

Tests: multi-turn e2e validates the seed retrieval path end-to-end;
new isolated single-turn think test (ThinkOnce) asserts documentation
questions classify as DOCUMENTATION_QUERY free of multi-turn bias.

Also ignore /.env.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants