메인 콘텐츠로 건너뛰기
Topics API는 대화 토픽(여러 Episode를 그룹화하고 요약한 것)을 조회하고 검색하기 위한 인터페이스입니다. Slack에서의 논의, 회의 중 대화 등 일관된 대화를 관리할 수 있습니다.

개요

const client = new NdxClient({
  apiKey: process.env.NEURADEX_API_KEY,
  projectId: 'your-project-id',
});

// Topics API 접근
const topics = await client.topics.list();
const result = await client.topics.search('프로젝트 진행');

메서드 목록

메서드설명
list(options?)토픽 목록 조회
get(topicId)특정 토픽 조회
search(query, options?)토픽 벡터 검색

list()

페이지네이션이 포함된 토픽 목록을 조회합니다.

파라미터

options.page
number
기본값:"1"
페이지 번호
options.limit
number
기본값:"20"
페이지당 조회 건수

반환값

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;
}

사용 예

// 첫 번째 페이지 조회
const result = await client.topics.list();

for (const topic of result.data) {
  console.log(`${topic.title} (메시지 수: ${topic.messageCount})`);
}

// 페이지네이션
const page2 = await client.topics.list({ page: 2, limit: 10 });

get()

특정 토픽의 상세 정보를 조회합니다.

파라미터

topicId
string
필수
토픽 ID

사용 예

const topic = await client.topics.get('topic-123');

console.log(topic.title);
console.log(topic.summary);
console.log(`참가자: ${topic.participants?.join(', ')}`);

벡터 검색으로 토픽을 검색합니다. “그 논의”, “프로젝트 진행 이야기” 등 모호한 쿼리로도 관련 토픽을 찾을 수 있습니다.

파라미터

query
string
필수
검색 쿼리
options.limit
number
최대 결과 건수

반환값

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;
}

사용 예

// 토픽 검색
const result = await client.topics.search('프로젝트 진행');

for (const topic of result.results) {
  console.log(`${topic.title} (점수: ${topic.score})`);
}

// 건수 지정
const result = await client.topics.search('인증 방식 논의', { limit: 5 });

유스케이스

과거 논의 찾기

async function findDiscussion(keyword: string) {
  const result = await client.topics.search(keyword);

  if (result.results.length === 0) {
    console.log('관련 토픽을 찾지 못했습니다');
    return;
  }

  // 가장 관련성이 높은 토픽 상세 조회
  const topTopic = await client.topics.get(result.results[0].id);

  console.log(`토픽: ${topTopic.title}`);
  console.log(`요약: ${topTopic.summary}`);
  console.log(`참가자: ${topTopic.participants?.join(', ')}`);
  console.log(`기간: ${topTopic.startedAt} ~ ${topTopic.endedAt}`);
}

await findDiscussion('배포 플로우 변경');

다음 단계

Episodes API

이벤트 이력 관리

Knowledge API

지식 관리