elastic/elastic-labs

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

What is it

Elastic Labs is a GitHub repository from the company Elastic, meant to help developers learn and test the Elastic platform hands-on. It's not a single product — it's a bundle of working code samples: executable Python notebooks, small example apps, and supporting resources.

The README frames it as: "executable Python notebooks, sample apps, and resources for testing out the Elastic platform across search, security, and observability use cases."

What's inside

The repo contains three main kinds of material:

  1. Example apps — three listed:

    • Chatbot RAG App — a chatbot built with retrieval-augmented generation
    • Internal Knowledge Search — a tool for searching an organization's internal documents
    • Relevance Workbench — a tool for experimenting with search relevance
  2. Python notebooks — organized by topic (search, generative AI, LangChain integrations, document chunking, integrations with third-party AI services)

  3. Supporting resources — links to external Elastic tutorial sites

What you can learn and build

Search / AI search

  • Use Elasticsearch as a vector database — store embeddings, run kNN (nearest-neighbor) search, and combine vector search with keyword search via hybrid search and reciprocal rank fusion (RRF)
  • Build RAG (retrieval-augmented generation), question-answering, and chatbot apps using semantic_text, the inference API, and semantic reranking
  • Get good semantic search out of the box with ELSER and multilingual E5 models — no training or fine-tuning needed
  • Tune how relevant results are with query rules, synonyms, and learning-to-rank
  • Connect Elasticsearch to external AI services: OpenAI, Hugging Face, Cohere, Amazon Bedrock, Anthropic, and LangChain

Observability

  • Instrument your services with OpenTelemetry (including Elastic's own distribution, EDOT) — sending traces, metrics, and logs to Elastic
  • Query and analyze logs at scale with ES|QL and other languages like PromQL
  • Monitor LLM-powered apps — latency, token usage, and cost
  • Speed up troubleshooting with the Elastic Agent Builder and machine-learning anomaly detection

Security

  • Reproduce threat-hunting and detection-engineering techniques from Security Labs, using ES|QL and EQL query languages
  • Explore tools behind malware analysis and threat intelligence write-ups
  • Test attacks against LLM applications (such as prompt injection) and learn how to detect them

Who maintains it

The README states the Search team at Elastic maintains the repository and is happy to help. They list multiple support channels:

  • Paid Elastic subscription customers: official support services (but note: these do not apply to the sample code in this repo)
  • Discuss forum (tag #esre-elasticsearch-relevance-engine)
  • Elastic Community Slack (channel #search-esre-relevance-engine)

Contribution & license

  • Contributing: the README points to a CONTRIBUTING.md file
  • License: Apache License, version 2.0 (ALv2)

Related

  • Project
  • Project
  • Project
  • Project