Skip to content
This repository was archived by the owner on Aug 21, 2026. It is now read-only.

RSM-306: add neutral /research engine HTTP boundary on cheaper LLM defaults - #266

Closed
virafb wants to merge 3 commits into
langchain-ai:mainfrom
raochra:raochra/engine-api-boundary
Closed

virafb wants to merge 3 commits into
langchain-ai:mainfrom
raochra:raochra/engine-api-boundary

Conversation

@virafb

@virafb virafb commented Apr 29, 2026

Copy link
Copy Markdown

Summary

Stands up this Raochra-owned ODR fork as a generic deep-research engine behind sensemaker-studio's ConsultingResearcher adapter (post-RSM-307 neutral seam).

  • src/open_deep_research/engine_models.py — Pydantic schemas mirroring sensemaker-studio's DeepResearchEngineRequest / DeepResearchEngineResult exactly. Engine vocabulary only.
  • src/open_deep_research/engine_server.py — FastAPI app: POST /research with Bearer auth (OPEN_DEEP_RESEARCH_API_KEY), X-Request-ID echoed as runtime_trace_ref, typed error envelope (authority_limited / budget_exhausted / schema_invalid / internal_error). Wraps the langgraph deep_researcher graph.
  • RAOCHRA.md — fork notes: upstream baseline (langchain-ai/open_deep_research@0dd30bd), local stand-up procedure, cheaper-LLM provider posture (Qwen / Kimi / GLM / MiniMax via OpenAI-compatible endpoints).
  • pyproject.toml — adds fastapi and uvicorn[standard]; drops duckduckgo-search (unused, only on the deprecated legacy/ path; pulls lxml which fails to build under Python 3.14 wheels).
  • .python-version — pins to 3.11 to match langgraph.json's declared python_version and resolve wheels for cffi / zstandard / etc.
  • src/open_deep_research/configuration.py — default models swapped from openai:gpt-4.1[-mini] to openai:qwen-plus / qwen-turbo. Operators override via OPENAI_API_BASE_URL + per-model env vars.

Engine code stays generic. Consulting concepts (framework constraints, source-authority tiers, knowledge layers) flow through request fields and are treated opaquely.

Out of scope here

  • Consulting prompt overlays (planning/synthesis tone, disconfirming discipline) — Raochra issue RSM-308.
  • Cloud Run production deploy — separate slice.
  • Closeout BV across consulting use cases (UC-001..005) — Raochra issue RSM-185.

Test plan

  • uv sync resolves cleanly under Python 3.11 with lxml/cffi chains gone.
  • open_deep_research.engine_server imports cleanly; FastAPI registers POST /research and GET /health.
  • Local stand-up via uv run uvicorn ... boots and serves /health (verifying in this turn).
  • Live /research call against a running fork instance with real Qwen + Tavily keys returns a contract-conformant DeepResearchEngineResult (operator step; gated test in sensemaker-studio).

🤖 Generated with Claude Code

virafb added 3 commits April 29, 2026 15:12
Adds the engine HTTP boundary the sensemaker-studio ConsultingResearcher
adapter expects (post-RSM-307 neutral seam):

- src/open_deep_research/engine_models.py — Pydantic schemas for the neutral
  DeepResearchEngineRequest / DeepResearchEngineResult contract; field names
  and types match the sensemaker-studio seam exactly (task_id,
  research_target, research_plan_seed, access_context, source_preferences,
  task_context, preference_context, topic_lens_scope, ConsultedArtifact,
  CandidateInsight, etc.).
- src/open_deep_research/engine_server.py — FastAPI app exposing
  POST /research (Bearer auth via OPEN_DEEP_RESEARCH_API_KEY, X-Request-ID
  echoed as runtime_trace_ref) and GET /health. Wraps the langgraph
  deep_researcher graph; maps the langgraph final state into a
  contract-conformant result. Schema-level mapping is best-effort here;
  consulting-flavored shaping (disconfirming discipline, contradiction
  surfacing, evidence framing) is RSM-308 overlay-side work.
- RAOCHRA.md — fork notes: upstream baseline commit
  (0dd30bd), HTTP boundary reference,
  local stand-up procedure, and the cheaper LLM provider posture (Qwen /
  Kimi / GLM / MiniMax via OpenAI-compatible endpoints).
- pyproject.toml — adds fastapi and uvicorn[standard] for the HTTP layer.

Engine code stays generic. Consulting concepts flow in via request fields
and back out via the result schema; the engine treats them opaquely.
duckduckgo-search was an upstream-ODR optional search provider; RSM-306
runs Tavily primary + Brave secondary, so DuckDuckGo is dead weight in
the consulting deployment. Removing it also drops the lxml chain whose
5.4.0 build was failing under Python 3.14 (no wheels yet, source build
needs libxml2-dev).

Pinning .python-version to 3.11 so `uv sync` matches `langgraph.json`'s
declared python_version and resolves wheels for cffi / zstandard / etc.
across the langsmith / langgraph dep tree.

Verified: open_deep_research.engine_server imports cleanly and FastAPI
registers POST /research and GET /health.
Per Raochra cost posture, defaults move off OpenAI/Anthropic to a cheaper
OpenAI-compatible provider:

- summarization_model: openai:gpt-4.1-mini -> openai:qwen-turbo
- research_model:      openai:gpt-4.1      -> openai:qwen-plus
- compression_model:   openai:gpt-4.1      -> openai:qwen-plus
- final_report_model:  openai:gpt-4.1      -> openai:qwen-plus

Operators set OPENAI_API_BASE_URL (e.g., DashScope's
https://dashscope-intl.aliyuncs.com/compatible-mode/v1) and OPENAI_API_KEY
to point at their chosen Qwen / Kimi / GLM / MiniMax provider; per-model
overrides via SUMMARIZATION_MODEL / RESEARCH_MODEL / etc. env vars.

Verified: configuration loads cleanly with the new defaults.
@virafb

virafb commented Apr 29, 2026

Copy link
Copy Markdown
Author

Mistargeted — this PR belongs on the Raochra-owned fork, not upstream. Closing and reopening internally. Sorry for the noise.

@virafb virafb closed this Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant