Skip to main content

talonic_search

Omnisearch across documents, fields, sources, and schemas in the workspace. Use for conceptual or fuzzy queries.

`talonic_search` is designed for discovery. When a user asks a question like 'do I have any contracts about indemnification?' or 'find documents from Acme', this is the right tool. It searches across document filenames, extracted field values, schema names, and source metadata using semantic and fuzzy matching.

The response is grouped by entity type: documents, fieldMatches, schemas, sources, and fields. Each result includes a relevance score (0..1) so the agent can assess match quality. Results with scores below 0.5 are typically not relevant and can be omitted when presenting to the user.

For queries that require exact field-value matching (like 'invoices over 1000 EUR'), use `talonic_filter` instead. Search is for exploration and discovery; filter is for precision queries against structured data.

ParameterTypeDescription
query *stringThe search query. Supports fuzzy and conceptual matching.
limitintegerMaximum results per entity type. Default: 5.

A common agent pattern is using talonic_search as a first step to orient within a workspace, then following up with more specific tools. For example, an agent might search for 'Acme contracts' to discover relevant documents, note the canonical field names in the response, and then use talonic_filter with those field names to narrow down to contracts expiring within a specific date range. This search-then-filter pattern is both efficient and reliable.

Search results are scoped to the authenticated workspace. The query runs against all documents, extracted field values, schema definitions, and source metadata within that workspace. There is no cross-workspace search — each API key sees only its own data. The limit parameter controls how many results are returned per entity type (documents, fields, schemas, sources), with a default of 5. Increase the limit when the user needs a broader view of matching content.

Search results include canonical field names in fields[].canonicalName. These names can be used directly in talonic_filter conditions, making search a good first step before building precise filters.
Every fieldMatches[] and fields[] entry carries a dataType ("string", "number", "array", etc.). Use it to pick the right talonic_filter operator on the first call — numeric operators (gt, gte, lt, lte, between) only resolve correctly when dataType === "number". See the *Schema typing* section under talonic_filter for the full preventive / reactive pattern.

Example

Tool input
{
  "query": "indemnification clauses Acme",
  "limit": 10
}
Tool response
{
  "documents": [
    {
      "id": "doc_4e7b...",
      "filename": "acme-services-agreement.pdf",
      "type_detected": "Services Agreement",
      "score": 0.92
    }
  ],
  "fieldMatches": [
    {
      "fieldName": "indemnification.cap_amount",
      "documentId": "doc_4e7b...",
      "value": "2x annual fees",
      "documentCount": 3,
      "filterable": true,
      "dataType": "string",
      "score": 0.88
    }
  ],
  "schemas": [],
  "sources": [],
  "fields": [
    { "canonicalName": "indemnification.cap_amount", "dataType": "string", "filterable": true }
  ]
}

Example: search then filter

Step 1: discover field names with search
// Agent calls talonic_search:
{
  "query": "vendor invoices total amount",
  "limit": 5
}

// Response includes canonical field names plus dataType:
{
  "fields": [
    { "canonicalName": "vendor.name", "dataType": "string", "filterable": true },
    { "canonicalName": "invoice.total_eur", "dataType": "number", "filterable": true },
    { "canonicalName": "invoice.due_date", "dataType": "string", "filterable": true }
  ]
}
Step 2: use discovered field names in talonic_filter
// Agent uses canonical names from search to build a filter:
{
  "conditions": [
    { "field": "invoice.total_eur", "operator": "gt", "value": 500 }
  ],
  "sort": { "field": "invoice.total_eur", "direction": "desc" }
}

Frequently asked questions

What does talonic_search do?+
It searches across documents, fields, sources, and schemas in the workspace using fuzzy and conceptual matching.
When should I use talonic_search vs talonic_filter?+
Use search for discovery and fuzzy queries ('find Acme contracts'). Use filter for precise field-value conditions ('invoices over 1000 EUR'). Search is exploration; filter is precision.
What do the search scores mean?+
Each result includes a relevance score from 0 to 1. Scores above 0.7 are strong matches, 0.5-0.7 are partial matches, and below 0.5 are typically not relevant.
Can I search for schemas by name?+
Yes. talonic_search includes schemas in its results. If you search for 'invoice', any schema with 'invoice' in its name or description will appear in the schemas array of the response. This is useful for discovering existing templates before creating new ones.
How do I use search results to build a filter?+
The fields array in the search response includes canonicalName values with a filterable flag. Use canonicalName values where filterable is true as the field parameter in talonic_filter conditions. This search-then-filter pattern is the recommended workflow for precise queries.