Discovery

New
Updated

The chaos.discovery namespace provides access to AI-generated research reports that cover DeFi protocols, market trends, and asset analysis. Reports are updated continuously as on-chain conditions change.

Use this namespace to browse published reports, retrieve full report details with sources, find research for a specific asset, and send follow-up questions to continue a research session.

quickstart.ts
import { Chaos } from '@chaoslabs/ai-sdk';
 
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
 
// Browse the latest reports
const { data: reports, total } = await chaos.discovery.list({ page: 1, limit: 5 });
console.log(`${total} reports available`);
 
// Get the full details of the first report
const detail = await chaos.discovery.get(reports[0].id);
console.log(detail.title);
console.log(`Sources: ${detail.sources.length}`);
console.log(`Follow-ups: ${detail.followup_questions.join(', ')}`);

Method Reference

MethodHTTPEndpointReturns
list(params?)GET/v1/discoveryDiscoveryListResponse
suggestedQueries(limit?)GET/v1/discovery/suggested-queriesLatestDiscoveryResponse
get(sessionId)GET/v1/discovery/{sessionId}DiscoveryReportDetails
byAsset(assetType, assetId, params?)GET/v1/discovery/assets/{assetType}/{assetId}DiscoveryListResponse
followUp(sessionId, params)POST/v1/discovery/{sessionId}/follow-upSessionData

Core Types

discovery-types.ts
interface DiscoveryReport {
  id: string;
  title: string;
  description: string;
  tags: string[];
  updated_at: string;
  updated_by: UpdatedBy;
  image_url?: string | null;
  suggested_user_queries: SuggestedQuery[];
  sources: Reference[];
}
 
interface DiscoveryReportDetails extends DiscoveryReport {
  content: unknown[];
  followup_questions: string[];
}
 
interface DiscoveryListResponse {
  total: number;
  data: DiscoveryReport[];
}
 
interface DiscoveryReportSummary {
  id: string;
  title: string;
  image_url?: string | null;
  tags: string[];
  updated_at: string;
  suggested_user_queries: SuggestedQuery[];
}
 
interface LatestDiscoveryResponse {
  reports: DiscoveryReportSummary[];
}
 
interface DiscoveryListParams {
  page?: number;
  limit?: number;
  tag?: string;
}
 
interface DiscoveryByAssetParams {
  page?: number;
  limit?: number;
}
 
interface FollowUpParams {
  query: string;
}
 
interface SuggestedQuery {
  query: string;
  query_type: string;
}
 
interface Reference {
  url: string;
  title?: string | null;
  description?: string | null;
}
 
interface UpdatedBy {
  name: string;
  user_id: string;
  image_url?: string | null;
}
 
type AssetType = 'crypto' | 'stock' | 'equity' | 'bond' | 'commodity' | 'forex' | 'derivative' | 'etf' | 'index';
 
interface SessionData {
  sessionId: string;
  userId: string;
  createdAt: number;
  updatedAt: number;
  type: string;
  workflowId: string;
  workflowName: string;
  title: string;
  isBookmarked: boolean;
  isPublished: boolean;
  blocks: unknown[];
  agentMessages: unknown[];
}
Was this helpful?