elastic/elastic-labs

Notebooks & Example Apps for Search, Observability, and Security with Elasticsearch

Jupyter Notebook

1,139

671 commits

updated Oct 9, 2026

See the code

README

Elasticsearch Examples & Apps

This repo contains executable Python notebooks, sample apps, and resources for testing out the Elastic platform across search, security, and observability use cases.

Visit Elastic Labs for the latest articles, tutorials, and more.

What you can build & learn

Elasticsearch:

  • Use Elasticsearch as a vector database to store embeddings, run kNN search, and merge vector and keyword results with hybrid search and reciprocal rank fusion (RRF).
  • Build retrieval augmented generation (RAG), question answering, and chatbot apps with semantic_text, the inference API, and semantic reranking.
  • Get strong semantic search out of the box with ELSER and multilingual E5, without training or fine-tuning a model.
  • Tune relevance with query rules, synonyms, and learning to rank.
  • Connect Elasticsearch to OpenAI, Hugging Face, Cohere, Amazon Bedrock, Anthropic, and LangChain.

Observability:

  • Instrument your services with OpenTelemetry (OTel), including the Elastic Distributions of OpenTelemetry (EDOT), and send traces, metrics, and logs to Elastic.
  • Query and analyze logs at scale with ES|QL and other query languages like PromQL.
  • Monitor LLM-powered apps, including latency, token usage, and cost.
  • Speed up root cause analysis with Elastic Agent Builder and machine learning anomaly detection.

Security:

  • Reproduce the detection engineering and threat hunting techniques from Security Labs Threat Command with ES|QL and EQL queries.
  • Explore the tooling behind malware analysis and threat intelligence write-ups.
  • Test attacks against LLM applications, such as prompt injection, and learn how to detect them.

Watch, fork, or star the Elastic Labs repo on GitHub for the latest updates.

Apps

Python notebooks 📒

The notebooks folder contains a range of executable Python notebooks, so you can test these features out for yourself. Colab provides an easy-to-use Python virtual environment in the browser.

Generative AI

Playground RAG Notebooks

Try out Playground in Kibana with the following notebooks:

LangChain

Document Chunking

Semantic reranking

Integrations

Model Upgrades

Contributing 🎁

See contributing guidelines.

Support 🛟

The Search team at Elastic maintains this repository and is happy to help.

Official Support Services

If you have an Elastic subscription, you are entitled to Support services for your Elasticsearch deployment. See our welcome page for working with our support team. These services do not apply to the sample application code contained in this repository.

Discuss Forum

Try posting your question to the Elastic discuss forums and tag it with #esre-elasticsearch-relevance-engine

Elastic Slack

You can also find us in the #search-esre-relevance-engine channel of the Elastic Community Slack

License ⚖️

This software is licensed under the Apache License, version 2 ("ALv2").

ai
applications
chatgpt
chatlog
elastic
elasticsearch
genai
genaistack
langchain
langchain-python
openai
openai-chatgpt
python
search
vector
vectordatabase

elastic/elastic-labs

Notebooks & Example Apps for Search, Observability, and Security with Elasticsearch

Jupyter Notebook

1,139

671 commits

updated Oct 9, 2026

See the code

README

Elasticsearch Examples & Apps

This repo contains executable Python notebooks, sample apps, and resources for testing out the Elastic platform across search, security, and observability use cases.

Visit Elastic Labs for the latest articles, tutorials, and more.

What you can build & learn

Elasticsearch:

  • Use Elasticsearch as a vector database to store embeddings, run kNN search, and merge vector and keyword results with hybrid search and reciprocal rank fusion (RRF).
  • Build retrieval augmented generation (RAG), question answering, and chatbot apps with semantic_text, the inference API, and semantic reranking.
  • Get strong semantic search out of the box with ELSER and multilingual E5, without training or fine-tuning a model.
  • Tune relevance with query rules, synonyms, and learning to rank.
  • Connect Elasticsearch to OpenAI, Hugging Face, Cohere, Amazon Bedrock, Anthropic, and LangChain.

Observability:

  • Instrument your services with OpenTelemetry (OTel), including the Elastic Distributions of OpenTelemetry (EDOT), and send traces, metrics, and logs to Elastic.
  • Query and analyze logs at scale with ES|QL and other query languages like PromQL.
  • Monitor LLM-powered apps, including latency, token usage, and cost.
  • Speed up root cause analysis with Elastic Agent Builder and machine learning anomaly detection.

Security:

  • Reproduce the detection engineering and threat hunting techniques from Security Labs Threat Command with ES|QL and EQL queries.
  • Explore the tooling behind malware analysis and threat intelligence write-ups.
  • Test attacks against LLM applications, such as prompt injection, and learn how to detect them.

Watch, fork, or star the Elastic Labs repo on GitHub for the latest updates.

Apps

Python notebooks 📒

The notebooks folder contains a range of executable Python notebooks, so you can test these features out for yourself. Colab provides an easy-to-use Python virtual environment in the browser.

Generative AI

Playground RAG Notebooks

Try out Playground in Kibana with the following notebooks:

LangChain

Document Chunking

Semantic reranking

Integrations

Model Upgrades

Contributing 🎁

See contributing guidelines.

Support 🛟

The Search team at Elastic maintains this repository and is happy to help.

Official Support Services

If you have an Elastic subscription, you are entitled to Support services for your Elasticsearch deployment. See our welcome page for working with our support team. These services do not apply to the sample application code contained in this repository.

Discuss Forum

Try posting your question to the Elastic discuss forums and tag it with #esre-elasticsearch-relevance-engine

Elastic Slack

You can also find us in the #search-esre-relevance-engine channel of the Elastic Community Slack

License ⚖️

This software is licensed under the Apache License, version 2 ("ALv2").

ai
applications
chatgpt
chatlog
elastic
elasticsearch
genai
genaistack
langchain
langchain-python
openai
openai-chatgpt
python
search
vector
vectordatabase

Significant stargazers

Karel Minarik

720 followers · starred Aug 2023

Benjamin Trent

147 followers · starred Sep 2023

Hakan Özler

536 followers · starred Aug 2026

Max Jakob

51 followers · starred Oct 2024