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!

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

Labels

integration Third-party / provider integrations vendor-integration Integration contributed by a vendor / dev-rel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants