Skip to content

Add agentic search - #146

Open
esmarkowski wants to merge 2 commits into
feature/add-search-pipelinesfrom
feature/add-agentic-search
Open

esmarkowski wants to merge 2 commits into
feature/add-search-pipelinesfrom
feature/add-agentic-search

Conversation

@esmarkowski

@esmarkowski esmarkowski commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Relations can now build the top-level agentic query clause. Agentic search runs through a search pipeline whose agentic_query_translator processor points at a Stretchy agent. Pipeline processors resolve agent: to agent_id, the same way they resolve model: to model_id.

class ProductSearchAgent < Stretchy::MachineLearning::Agent
  agent_type :flow
  tool :query_planning, model: :claude_model
end

class AgenticPipeline < Stretchy::SearchPipeline
  request_processor :agentic_query_translator, agent: :product_search_agent
end

Product.search_pipeline(:agentic_pipeline).agentic("red shoes under $50", query_fields: [:name]).to_elastic
# => { "query" => { "agentic" => { "query_text" => "red shoes under $50", "query_fields" => ["name"] } } }

A later agentic call replaces an earlier one, because OpenSearch only accepts agentic as the top-level query. OpenSearch 3.9.0 parses the clause and asks for the translator processor. A full run needs an LLM connector and was not exercised.

Docs changes:

  • The machine learning guide covers model groups, agents, agentic search and the rake tasks.
  • The pipelines guide covers search pipelines.
  • A RAG agent example is added.
  • The README drops the elasticsearch-persistence link and notes the opensearch-ruby 4 and json < 3 requirements.

Specs pass on OpenSearch 3.9.0, OpenSearch 2.19.7 and Elasticsearch 8.12.2.

Closes #139

Spencer Markowski and others added 2 commits November 16, 2026 17:36
`Post.agentic("red shoes", query_fields: [:title], memory_id: "m1")` builds
the top level agentic query clause. A later call replaces an earlier one,
since OpenSearch only accepts agentic as the top level query.

Pipeline processors resolve `agent:` to `agent_id`, so
`request_processor :agentic_query_translator, agent: :product_search_agent`
points the translator at a Stretchy agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The machine learning guide covers model groups, agents, agentic search and
the agent rake tasks, and notes that ML is OpenSearch-only, register no
longer deploys and deployed? is not cached. The pipelines guide covers
search pipelines, default_search_pipeline, search_pipeline and the
Stretchy::Pipeline deprecation. Adds a RAG agent example.

The README points at the OpenSearch Query DSL instead of
elasticsearch-persistence and notes the opensearch-ruby 4 and json < 3
requirements. The LLM example calls predict_model, since opensearch-ruby 4's
predict needs an algorithm name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@esmarkowski
esmarkowski added this pull request to stack #142 November 16, 2026 22:38
@esmarkowski esmarkowski changed the title feature/add agentic search Add agentic search Nov 16, 2026
@esmarkowski
esmarkowski marked this pull request as ready for review November 16, 2026 22:38

This branch has not been deployed

No deployments
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.

Add agentic search

1 participant