Search

Smart Search SDK allows you to perform semantic, lexical, and vector-based queries on your connected data sources. This section covers both the current and deprecated search methods.

chevron-rightInitializationhashtag

Environment Setup

Make sure your environment variables are configured correctly in the .env file:

Update your environment configuration file as shown below:

SMARTSEARCH_BASE_URL=<your-api-url>
SMARTSEARCH_TOKEN=<your-auth-token>
BOSA_TOKEN=<your-bosa-token>

Initialize the Search Client

from smartsearch.search.client import SmartSearchSearchClient

client = SmartSearchSearchClient(
    base_url=os.getenv("SMARTSEARCH_BASE_URL"),
    cache_manager=cache_manager
)

Authenticate with Token

await client.authenticate(token=os.getenv("SMARTSEARCH_TOKEN"))

Must be called once before making any search requests.


Usage

1. Perform a Search (Recommended)

Execute a query by specifying a search_profile_name, search string, and optional pagination parameters.

Parameters:

Name
Type
Description

search_profile_names

string

data sources (current choices between github, google_calendar, google_drive, google_mail, general)

query

string

The user's search input

size

int

(Optional) Number of results to return


Full Code Snippet

Last updated