Skip to main content

Search First Cookbook

Build a complete search application with highlights, facets, and entity expansion.

What You’ll Build

A search interface that:
  • Ingests documents
  • Returns highlighted results
  • Shows faceted filters
  • Displays related entities

Prerequisites

  • cogmem-kos installed and running
  • Python 3.12+
  • httpx for API calls

Step 1: Ingest Documents

First, let’s add some sample documents:

Step 2: Wait for Processing

The worker needs to process the documents:
Wait a few seconds for chunking and indexing. Now search for content:

Step 4: Display Facets

Show faceted filters:
Output:

Step 5: Filter by Facet

Apply a facet filter:
Display entities mentioned in results:
Output:

Complete Example

Next Steps

Entity Pages

Build entity detail views

Integrations

Connect to AI frameworks