Skip to content

Add example notebook for itinerary planning using OpenStreetMap-integration,and Haystack Agent#258

Open
grexrr wants to merge 4 commits intodeepset-ai:mainfrom
grexrr:main
Open

Add example notebook for itinerary planning using OpenStreetMap-integration,and Haystack Agent#258
grexrr wants to merge 4 commits intodeepset-ai:mainfrom
grexrr:main

Conversation

@grexrr
Copy link
Copy Markdown

@grexrr grexrr commented Nov 16, 2025

This PR adds a tutorial notebook demonstrating how to use the OSMFetcher from osm-integration-haystack with Haystack's Agent framework.

The notebook includes:

  • A pipeline that fetches nearby POIs from OpenStreetMap and summarizes them
  • A PipelineTool wrapping OSMFetcher + ChatPromptBuilder to reduce token usage
  • An Agent that uses this tool to plan walking itineraries based on user prompts
  • Example use case: visiting a church → studying in a cafe → ending at a pub

The agent is guided via a system prompt and handles tool invocation autonomously.

This notebook was added following reviewer feedback on my OpenStreetMap integration PR, to illustrate how the component can be used in an Agent-based application.

@grexrr grexrr requested a review from a team as a code owner November 16, 2025 01:15
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@kacperlukawski kacperlukawski self-requested a review March 3, 2026 08:53
@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rename this notebook to something like "Agentic itinerary planning using OpenStreetMap"? I feel we should focus on the goal of this notebook.


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the "OpenStreetMap + Haystack: From basic queries to agents" header, as there is already a notebook title above.

Would you like to put author attribution here?


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the section title might be confusing for the readers. Vectorization is quite common in RAG-like pipelines, and people tend to think about vector embeddings. Can we rename it?


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #4.    if "OPENAI_API_KEY" in os.environ:

Could you please remove that part? I makes automated testing impossible, if we delete the env variable.


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we install that dependency at the very beginning of the notebook? That's what we typically do.


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #1.    def preview_documents(docs, limit=5):

Could we add type hints?


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Part2 -> Part 2 (missing space)


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recalled -> recall


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #20.    itinerary_prompt_builder = ChatPromptBuilder(template=itinerary_prompt_template)

Could you please add required_variables=["documents", "user_request"] to avoid having a warning?


Reply via ReviewNB

@@ -0,0 +1,1237 @@
{
Copy link
Copy Markdown
Member

@kacperlukawski kacperlukawski Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STRONGLY ADVICED -> strongly advised


Reply via ReviewNB

@kacperlukawski
Copy link
Copy Markdown
Member

Thanks for contributing this example, @grexrr. Let me apologize it took so long, but we're catching up with the community contributions. I really liked the idea, but left some minor comments!

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.

2 participants