Skip to content

Feat/agentic search cosmos retriever - #148

Closed
aryan-410 wants to merge 17 commits into
AzureCosmosDB:mainfrom
aryan-410:feat/agentic-search-cosmos-retriever
Closed

Feat/agentic search cosmos retriever#148
aryan-410 wants to merge 17 commits into
AzureCosmosDB:mainfrom
aryan-410:feat/agentic-search-cosmos-retriever

Conversation

@aryan-410

Copy link
Copy Markdown

No description provided.

cosmos-dev and others added 17 commits June 26, 2026 21:57
FastAPI service (POST /search, GET /health) wrapping CosmosRetriever, which
runs a multi-turn retrieval agent over a Cosmos DB corpus. Pluggable inference
backend: harmony_vllm (fine-tuned pat-jj/harness-1), openai_chat (any
OpenAI-compatible chat model), or openai_responses (reasoning models such as
gpt-5.4 on Azure AI Foundry). Includes tests for the server and agent loops.

The .NET agentic_search tool calls this service over HTTP.
Add a 9th MCP tool, agentic_search, that runs the Cosmos Retriever agent over
a Cosmos DB corpus and returns ranked, curated documents.

- AgenticSearchExecutor: calls the cosmos-retriever service over HTTP
  (COSMOS_RETRIEVER_URL, COSMOS_RETRIEVER_TIMEOUT_S); always returns parseable
  JSON (error envelope on failure).
- Wire into Program.cs, MCPProtocolController (tools/list + tools/call),
  MCPTestController, and McpToolRequestValidator.
- CosmosClientFactory: exclude ManagedIdentityCredential (fall through to az
  login); accept the standard MCP _meta params field.
- Docs: docs/AGENTIC_SEARCH.md, README + CHANGELOG + .env.example.
…rness

- Move VllmTokenCompleter + run_single_episode into inference/vllm_policy.py
- Delete inference/evaluate_harness1_vllm.py (eval/benchmark code)
- Repoint retriever.py to vllm_policy; update env_rl docstring
- Include pre-existing: pool_doc_ids trajectory pooling (openai_chat), optional baseten import (rerank)
The datagen/ package deletion was previously only staged, never committed, so
it still appeared in the PR. Actually remove it (search_dataset.py,
generate_sft_rl_splits.py, BrowseComp-Plus, README, __init__) along with the
unit tests folder, the datagen TYPE_CHECKING import in tasks.py, the stale
datagen comment in config.py, and the now-dangling pytest/respx dev deps and
pytest/ruff test config in pyproject.toml.
…lResult

Add a trajectory field to RetrievalResult populated by the harmony_vllm
backend: the search queries issued (search_history), per-turn tool calls
(turn_tools), programmatic per-turn status summaries (turn_summaries), and the
final per-doc importance tags from curation (curated_importance).
…ed retrieval layer

- Add schema-driven retrieval package (planner/compiler/executor/strategies/
  document-resolvers) decoupled from physical Cosmos paths
- Endpoint-only inference (OpenAI chat/responses); drop vLLM/RL runtime
- Add foundry-harness and retrieval/agent benchmark scripts
…lt corpus profile); rename LegacyDunderCodec -> DunderChunkCodec
…loop.py and ChatSearchResult -> AgentSearchResult (both backends live there); keep backend-id strings
…undry Messages API); refresh backend docs/.env
@aryan-410

Copy link
Copy Markdown
Author

Superseded by #150, which adds cross-collection retrieval and live schema discovery on top of this work.

@aryan-410 aryan-410 closed this Jul 23, 2026
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