> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/reasoning.md).

# DataForB2B Reasoning

Natural-language, LLM-friendly search over DataForB2B's B2B database — describe the people or companies you're looking for in plain English instead of building structured filters by hand.

## Smart Search

### What it is

Natural-language search for people, leads or companies using DataForB2B's B2B database — describe your ideal lead or ICP in plain English and get matching profiles. Handles clarifying questions.

### How it works

The block sends either a natural-language `query` or a continuation pair of `session_id` and `answers` to DataForB2B's reasoning-search endpoint; mixed or incomplete request modes are rejected. The API translates the query into structured filters and may return `status: needs_input` with `questions` and a `session_id` for a follow-up call. On success, copy `applied_filters` into People Search or Company Search's `filters_json` input and set `offset` to paginate beyond the first page; a `complete` response may still contain an empty `results` list. Client and server errors are caught and surfaced via the `error` output instead of raising an exception.

### Inputs

| Input        | Description                                                                                          | Type                  | Required |
| ------------ | ---------------------------------------------------------------------------------------------------- | --------------------- | -------- |
| query        | Plain-English LinkedIn search / ICP (e.g. 'marketing directors at Series A SaaS startups in France') | str                   | No       |
| category     | What to search for: 'people' or 'company'                                                            | "people" \| "company" | No       |
| session\_id  | Session id to resolve a previous 'needs\_input' turn                                                 | str                   | No       |
| answers      | Answers to clarifying questions {question\_id: answer}                                               | Dict\[str, Any]       | No       |
| max\_results | Maximum results to return (1-100)                                                                    | int                   | No       |
| enrich\_live | Fetch fresh live data (uses more credits)                                                            | bool                  | No       |

### Outputs

| Output           | Description                                                                                                                                                 | Type            |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
| error            | Error message if the operation failed                                                                                                                       | str             |
| result           | Full reasoning-search response                                                                                                                              | Dict\[str, Any] |
| status           | 'complete' or 'needs\_input'                                                                                                                                | str             |
| results          | Matching results when status is complete                                                                                                                    | List\[Any]      |
| questions        | Clarifying questions when status is needs\_input                                                                                                            | List\[Any]      |
| session\_id      | Session id to continue the search                                                                                                                           | str             |
| applied\_filters | The structured filters the search applied. Feed this into People Search or Company Search 'filters\_json' with an offset to paginate beyond the first page. | Dict\[str, Any] |
| category         | Category searched ('people' or 'company', echoed from the input) — route pagination to the matching search block                                            | str             |

### Possible use case

**Conversational Lead Sourcing**: Let an agent describe an ICP in plain English (e.g. "marketing directors at Series A SaaS startups in France") and resolve it into a structured search without manually building filters.

**Multi-Turn Refinement**: Handle ambiguous requests by answering clarifying questions returned by the API, then continue the same session to completion.

**Search Handoff**: Reuse `applied_filters` in People Search or Company Search to paginate a natural-language result set.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://agpt.co/docs/integrations/block-integrations/reasoning.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
