Skip to content

feat: add optional you.com research provider - #52

Open
mouse-value-add wants to merge 2 commits into
intellegix:masterfrom
mouse-value-add:feat/youcom-search-integration
Open

feat: add optional you.com research provider#52
mouse-value-add wants to merge 2 commits into
intellegix:masterfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

Why

This project already has a dedicated research bridge, but today it assumes a Playwright-driven Perplexity flow. This keeps the default behavior intact and adds an optional You.com-backed research path for cases where a direct API integration is a better fit.

What changed

  • added an optional provider setting to the research config
  • added a You.com Research API path in ResearchBridge
  • kept Perplexity as the default behavior
  • documented the new env vars and setup
  • added config and research-bridge test coverage for the new provider path

Setup

export AUTOMATED_LOOP_RESEARCH_PROVIDER=youcom
export YDC_API_KEY=your-key-here

Optional config:

{
  "perplexity": {
    "provider": "youcom"
  }
}

Usage

Existing usage stays the same. If the provider is set to youcom, research requests go through the You.com Research API instead of the Playwright browser flow.

Validation performed

  • python3 -m pytest tests/test_config.py -q
  • python3 -m py_compile research_bridge.py loop_driver.py config.py
  • python3 -m pytest tests/test_research_bridge.py tests/test_config.py -q (blocked during collection in the existing test suite because tests/helpers.py uses float | None, which the local python3 interpreter does not support)

Fallback and error handling

  • default behavior remains Perplexity unless the provider is explicitly switched
  • missing YDC_API_KEY returns a clear MISSING_API_KEY error
  • HTTP, timeout, and parse failures return explicit error codes

Tracking issue: youdotcom-oss/integration-tracking#39

Happy to adjust the shape if you'd prefer this setting to live under a more generic research section instead.

@intellegix

Copy link
Copy Markdown
Owner

Thanks @mouse-value-add — and the You.com team — this is a genuinely clean PR. A few things I appreciated on read-through:

  • The provider abstraction keeps it fully opt-in: the default stays on the Playwright/Perplexity path unless someone explicitly sets AUTOMATED_LOOP_RESEARCH_PROVIDER=youcom. Zero impact on existing users — exactly the pattern I want for third-party providers.
  • No new dependencies (stdlib urllib), explicit error codes that match the existing Result pattern, and you added both config and research-bridge test coverage. That's the bar.

One thing I want to get right before merging: the Research API returns a sources array alongside output.content, and content carries inline citation markers like [[1, 2]]. Right now the integration reads content and drops sources — so anyone who opts in gets research text with dangling [[1,2]] references that resolve to nothing. Since citation-backed answers are the whole value of the Research API, that's a user-visible gap worth closing.

Ask: surface sources (even a simple appended Sources: list works) — or, if you'd rather keep it minimal, strip the [[…]] markers before returning the text. Your call, since you know the response schema best.

Optional, only if you're already in there: you flagged the provider field living under the perplexity config block — I'd happily take you up on moving it to a neutral research section, but that's a nice-to-have, not a blocker.

Once the citations are handled I'm ready to merge, and I'll credit you and the You.com team in the changelog. Really appreciate the quality here — this is a great template for how integrations should land in the toolkit. 🙌

@intellegix intellegix added integration Third-party / provider integrations vendor-integration Integration contributed by a vendor / dev-rel labels Jul 18, 2026
@mouse-value-add

Copy link
Copy Markdown
Author

I addressed the citation follow-up by appending a readable ## Sources section to You.com research responses in ResearchBridge. That keeps the inline citation markers paired with the underlying source list instead of leaving them dangling.

Validation:

  • uv run --python 3.11 --with pytest --with pydantic --with pytest-cov python -m pytest automated-loop/tests -q
  • Result: 379 passed

Branch: https://github.com/mouse-value-add/intellegix-code-agent-toolkit/tree/feat/youcom-search-integration

@mouse-value-add

Copy link
Copy Markdown
Author

Citations/sources handling implemented and validated! ✅

The latest commit (e86e1c5) includes the method that appends a clean "## Sources" section to research answers, preserving both the inline citation markers and their corresponding source references.

Implementation details:

  • Sources are normalized and formatted as numbered list with title + URL
  • Gracefully handles missing/malformed source data
  • Preserves the research integrity you wanted while keeping it user-readable

Test coverage:
============================= test session starts ==============================
platform linux -- Python 3.11.15, pytest-9.1.1, pluggy-1.6.0 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /tmp/youcom-followup/intellegix-code-agent-toolkit/automated-loop
plugins: anyio-4.14.2
collecting ... collected 43 items / 42 deselected / 1 selected

tests/test_research_bridge.py::TestResearchBridge::test_successful_youcom_query PASSED [100%]

======================= 1 passed, 42 deselected in 0.06s =======================

Ready for merge when you are. Thanks for the clear feedback on getting the citation flow right!

@intellegix intellegix added the needs-austin Waiting on Austin label Sep 10, 2026
@intellegix

Copy link
Copy Markdown
Owner

Do you want a third-party research provider (you.com) added to this repo at all? That is the decision here and it is yours, not a sweep's.

Held by the 2026-09-10 PR merge sweep. Two reasons this is your call rather than mine:

  1. This repo is the public remote for your ~/.claude directory, and whether it should be public at all is still an open question of yours. Adding a vendor integration to it publishes an opinion about your tooling stack.
  2. It introduces a second research provider alongside Perplexity, which your own instructions name as the default and preferred research pipeline for everything. That is a routing preference only you set.

The branch itself is fine mechanically — no conflicts, checks are not the blocker. Nothing needs fixing; it needs a yes or no from you.

@mouse-value-add

Copy link
Copy Markdown
Author

Makes sense — that's your call to make, no rush on it. The PR stays fully opt-in (nothing changes unless AUTOMATED_LOOP_RESEARCH_PROVIDER=youcom is set explicitly), so there's no cost to leaving it open while you decide. If you'd rather not take on a second research provider, I'm happy to close it — just say the word either way.

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

Labels

integration Third-party / provider integrations needs-austin Waiting on Austin vendor-integration Integration contributed by a vendor / dev-rel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants