The Topics API is an interface for retrieving and searching conversation topics (grouped and summarized Episodes). Manage coherent discussions from Slack conversations, meetings, and more.
Overview
const client = new NdxClient ({
apiKey: process . env . NEURADEX_API_KEY ,
projectId: 'your-project-id' ,
});
// Access Topics API
const topics = await client . topics . list ();
const result = await client . topics . search ( 'project progress' );
Method List
Method Description list(options?)Get topic list get(topicId)Get specific topic search(query, options?)Vector search topics
list()
Get a paginated list of topics.
Parameters
Return Value
interface TopicListResponse {
data : Topic [];
total : number ;
page : number ;
limit : number ;
totalPages : number ;
}
interface Topic {
id : string ;
projectId : string ;
integrationId : string | null ;
channelId : string | null ;
title : string ;
summary : string | null ;
messageCount : number | null ;
participants : string [] | null ;
startedAt : string | null ;
endedAt : string | null ;
createdAt : string ;
updatedAt : string ;
}
Usage
// Get first page
const result = await client . topics . list ();
for ( const topic of result . data ) {
console . log ( ` ${ topic . title } (messages: ${ topic . messageCount } )` );
}
// Pagination
const page2 = await client . topics . list ({ page: 2 , limit: 10 });
get()
Get details of a specific topic.
Parameters
Usage
const topic = await client . topics . get ( 'topic-123' );
console . log ( topic . title );
console . log ( topic . summary );
console . log ( `Participants: ${ topic . participants ?. join ( ', ' ) } ` );
search()
Search topics using vector search. Find related topics even with vague queries like “that discussion” or “project progress talk.”
Parameters
Maximum number of results
Return Value
interface TopicSearchResponse {
results : TopicSearchResult [];
query : string ;
}
interface TopicSearchResult {
id : string ;
title : string ;
summary : string | null ;
messageCount : number | null ;
participants : string [] | null ;
startedAt : string | null ;
score : number ;
}
Usage
// Search topics
const result = await client . topics . search ( 'project progress' );
for ( const topic of result . results ) {
console . log ( ` ${ topic . title } (score: ${ topic . score } )` );
}
// Specify limit
const result = await client . topics . search ( 'authentication discussion' , { limit: 5 });
Use Cases
Finding Past Discussions
async function findDiscussion ( keyword : string ) {
const result = await client . topics . search ( keyword );
if ( result . results . length === 0 ) {
console . log ( 'No related topics found' );
return ;
}
// Get details of the most relevant topic
const topTopic = await client . topics . get ( result . results [ 0 ]. id );
console . log ( `Topic: ${ topTopic . title } ` );
console . log ( `Summary: ${ topTopic . summary } ` );
console . log ( `Participants: ${ topTopic . participants ?. join ( ', ' ) } ` );
console . log ( `Period: ${ topTopic . startedAt } - ${ topTopic . endedAt } ` );
}
await findDiscussion ( 'deploy flow changes' );
Next Steps
Episodes API Event history management
Knowledge API Knowledge management