Skip to content

Add prompt repetition usage guide (PR3)#573

Open
qicesun wants to merge 11 commits intolangchain4j:mainfrom
qicesun:feat/prompt-repetition-pr3-docs
Open

Add prompt repetition usage guide (PR3)#573
qicesun wants to merge 11 commits intolangchain4j:mainfrom
qicesun:feat/prompt-repetition-pr3-docs

Conversation

@qicesun
Copy link
Contributor

@qicesun qicesun commented Feb 15, 2026

What

  • Add prompt repetition guide in langchain4j-community-core/README.md
  • Add root README link to this guide

Guide covers

  • Non-RAG setup with PromptRepeatingInputGuardrail
  • RAG setup with RepeatingQueryTransformer
  • AUTO mode boundaries
  • Idempotence behavior
  • A/B rollout checklist

Validation

  • ./mvnw -pl langchain4j-community-core verify -DskipITs

Depends on #571 and #572
Related #570

@qicesun
Copy link
Contributor Author

qicesun commented Feb 16, 2026

Validation results (using this PR code, gpt-4.1-mini, Feb 16, 2026)

Functional

  • langchain4j-community-core tests: 108/108 passed
  • End-to-end checks passed:
    • rewrite works in ALWAYS
    • AUTO skips reasoning-intent prompts
    • idempotence works
    • input guardrail skips when RAG augmentation exists
    • query transformer preserves metadata
    • query transformer runs in retrieval augmentor flow

A/B: Non-RAG (mode=ALWAYS)

Bucket Cases Exact A Exact B Delta
NameIndex 120 61.67% 79.17% +17.50pp
OptionsFirst 120 80.00% 100.00% +20.00pp
MiddleMatch 120 97.50% 100.00% +2.50pp
Aggregate 360 79.72% 93.06% +13.33pp

A/B: Reasoning control (mode=AUTO)

  • Cases: 80
  • Applied rate: 0%
  • Reasons: SKIPPED_REASONING_INTENT=80

A/B: RAG (mode=AUTO, query-side repetition)

  • Cases: 30
  • Exact: 1.00 -> 1.00

Conclusion: feature behavior is correct, and non-RAG objective tasks improve.

@qicesun qicesun changed the title [Draft] Prompt repetition PR3: rollout guide and best practices Add prompt repetition usage guide (PR3) Feb 16, 2026
@qicesun qicesun marked this pull request as ready for review February 16, 2026 07:47
@Martin7-1 Martin7-1 added enhancement New feature or request P2 High priority P3 Medium priority labels Feb 20, 2026
@qicesun
Copy link
Contributor Author

qicesun commented Mar 7, 2026

Quick update: I opened #592 as the new draft PR that carries prompt repetition forward in the dedicated langchain4j-community-prompt-repetition module requested during review.

I also found an upstream langchain4j bug in AiServices input-guardrail sequencing:

Because of that, #592 is now the main review target and this PR is effectively superseded by the dedicated-module draft plus the upstream fix.

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

Labels

enhancement New feature or request P2 High priority P3 Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants