Generate a Private Deep Research on a pipeline
Beta Feature
The API and Deep Research are currently in beta. Features and configuration may change.
Prerequisites
Before you begin, you'll need:
- A Vectorize account
- An API access token (how to create one)
- Your organization ID (see below)
- A pipeline ID (see below)
Finding your Organization ID
Your organization ID is in the Vectorize platform URL:
https://platform.vectorize.io/organization/[YOUR-ORG-ID]
For example, if your URL is:
https://platform.vectorize.io/organization/ecf3fa1d-30d0-4df1-8af6-f4852bc851cb
Your organization ID is: ecf3fa1d-30d0-4df1-8af6-f4852bc851cb
Finding your Pipeline ID
Navigate to your pipeline in the Vectorize platform. The pipeline ID is shown in:
- The URL:
https://platform.vectorize.io/organization/[org-id]/pipeline/[PIPELINE-ID]
- The pipeline details page
- The "Connect" tab of your pipeline
Generate the Deep Research
With your pipeline ID ready, you can now start a deep research task. This will analyze your pipeline's data to generate comprehensive insights based on your query.
- Python
- Node.js
# Create API interface
pipelines_api = v.PipelinesApi(api)
# Start deep research
response = pipelines_api.start_deep_research(
organization_id,
pipeline_id,
v.StartDeepResearchRequest(
query="What is the meaning of life?",
web_search=True # Enable web search for comprehensive results
)
)
research_id = response.research_id
print(f"Research started with ID: {research_id}")
const { PipelinesApi } = vectorize;
// Create API interface
const pipelinesApi = new PipelinesApi(apiConfig);
// Start deep research
const response = await pipelinesApi.startDeepResearch({
organizationId: organizationId,
pipelineId: pipelineId,
startDeepResearchRequest: {
query: "What is the meaning of life?",
webSearch: true // Enable web search for comprehensive results
}
});
const researchId = response.researchId;
console.log(`Research started with ID: ${researchId}`);
Get the Deep Research result
Deep Research tasks run asynchronously. Use the research ID returned from the previous step to check the status and retrieve your results.
- Python
- Node.js
# Create API interface
pipelines_api = v.PipelinesApi(api)
# Check research status and get results
max_attempts = 60 # Maximum 5 minutes (60 * 5 seconds)
attempt = 0
while attempt < max_attempts:
try:
response = pipelines_api.get_deep_research_result(
organization_id,
pipeline_id,
research_id
)
if response.ready:
if response.data.success:
print("Research completed successfully!")
print(response.data.markdown)
else:
print("Research failed:", response.data.error)
break
print("Research in progress...")
time.sleep(5) # Wait 5 seconds before checking again
attempt += 1
except Exception as e:
print(f"Error checking research status: {e}")
raise
if attempt >= max_attempts:
print("Research timed out after 5 minutes")
const { PipelinesApi } = vectorize;
// Create API interface
const pipelinesApi = new PipelinesApi(apiConfig);
// Check research status and get results
const maxAttempts = 60; // Maximum 5 minutes (60 * 5 seconds)
let attempt = 0;
let response;
while (attempt < maxAttempts) {
try {
response = await pipelinesApi.getDeepResearchResult({
organizationId: organizationId,
pipelineId: pipelineId,
researchId: researchId
});
if (response.ready) {
if (response.data.success) {
console.log("Research completed successfully!");
console.log(response.data.markdown);
} else {
console.log("Research failed:", response.data.error);
}
break;
}
console.log("Research in progress...");
await new Promise(resolve => setTimeout(resolve, 5000)); // Wait 5 seconds
attempt += 1;
} catch (error) {
console.log(`Error checking research status: ${error.message}`);
throw error;
}
}
if (attempt >= maxAttempts) {
console.log("Research timed out after 5 minutes");
}