Skip to content

docs(ai-sdk): clarify multi-source library selection#2870

Open
barry166 wants to merge 1 commit into
upstash:masterfrom
barry166:barry166/clarify-multiple-doc-sources-2069
Open

docs(ai-sdk): clarify multi-source library selection#2870
barry166 wants to merge 1 commit into
upstash:masterfrom
barry166:barry166/clarify-multiple-doc-sources-2069

Conversation

@barry166

@barry166 barry166 commented Jul 3, 2026

Copy link
Copy Markdown

Summary

  • clarify that Context7 can return separate repo and docs-site entries for the same project
  • tell agents to pick the source that best fits the user query
  • tell agents to try the sibling source before concluding docs are missing

Related to #2069.

Testing

  • corepack pnpm --filter @upstash/context7-sdk build
  • corepack pnpm --filter @upstash/context7-tools-ai-sdk typecheck
  • corepack pnpm --filter @upstash/context7-tools-ai-sdk build
  • corepack pnpm --filter @upstash/context7-tools-ai-sdk exec vitest run src/index.test.ts -t "should export RESOLVE_LIBRARY_ID_DESCRIPTION"
  • corepack pnpm --filter @upstash/context7-tools-ai-sdk exec prettier --check src/prompts/system.ts src/index.test.ts
  • git diff --check

Notes

AI-assisted: yes. I manually reviewed the diff and test output before opening this PR.

Full corepack pnpm --filter @upstash/context7-tools-ai-sdk test was not run to completion because the existing Bedrock-backed tests require AWS_REGION / AWS_BEARER_TOKEN_BEDROCK in the local environment. The targeted non-Bedrock regression test above passed.

Context7 can expose both repository and docs-site sources for the same project, but the AI SDK tool description did not tell agents how to handle that common shape. Add a narrow prompt hint so agents pick the source that fits the user's question and retry the sibling source before declaring documentation missing.

Constraint: Issue upstash#2069 notes multi-source libraries are currently offered separately

Rejected: Implement source unification | broader product work than the issue-comment workaround

Confidence: medium

Scope-risk: narrow

Directive: Keep this as selection guidance unless Context7 gains first-class multi-source library records

Tested: pnpm --filter @upstash/context7-sdk build

Tested: pnpm --filter @upstash/context7-tools-ai-sdk typecheck

Tested: pnpm --filter @upstash/context7-tools-ai-sdk build

Tested: pnpm --filter @upstash/context7-tools-ai-sdk exec vitest run src/index.test.ts -t 'should export RESOLVE_LIBRARY_ID_DESCRIPTION'

Tested: pnpm --filter @upstash/context7-tools-ai-sdk exec prettier --check src/prompts/system.ts src/index.test.ts

Tested: git diff --check

Not-tested: Full tools-ai-sdk test suite requires AWS_REGION/AWS_BEARER_TOKEN_BEDROCK for Bedrock-backed tests

Related: upstash#2069
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.

1 participant