Rememberizer Docs
로그인가입하기문의하기
한국어
한국어
  • 왜 Rememberizer인가?
  • 배경
    • 벡터 임베딩과 벡터 데이터베이스란?
    • 용어집
    • 표준화된 용어
  • 개인 사용
    • 시작하기
      • 지식 검색
      • 기념품 필터 접근
      • 공통 지식
      • 내장된 지식 관리
  • 통합
    • Rememberizer 앱
    • Rememberizer Slack 통합
    • Rememberizer Google Drive 통합
    • Rememberizer Dropbox 통합
    • Rememberizer Gmail 통합
    • Rememberizer Memory 통합
    • Rememberizer MCP 서버
    • 타사 앱 관리
  • 개발자 리소스
    • 개발자 개요
  • 통합 옵션
    • API 키 등록 및 사용
    • Rememberizer 앱 등록
    • Rememberizer 앱 승인
    • Rememberizer GPT 생성
    • LangChain 통합
    • 벡터 저장소
    • Slack과 대화하는 샘플 웹 앱
  • 기업 통합
    • 기업 통합 패턴
  • API 참조
    • API 문서 홈
    • 인증
  • 핵심 API
    • 의미적 유사성으로 문서 검색
    • 문서 검색
    • 문서 내용 검색
    • 슬랙 콘텐츠 검색
    • Rememberizer에 콘텐츠 기억하기
  • 계정 및 구성
    • 현재 사용자 계정 세부정보 가져오기
    • 사용 가능한 데이터 소스 통합 목록
    • 기념품
    • 추가된 모든 공개 지식 가져오기
  • 벡터 저장소 API
    • 벡터 저장소 문서
    • 벡터 저장소 정보 가져오기
    • 벡터 저장소의 문서 목록 가져오기
    • 문서 정보 가져오기
    • 벡터 저장소에 새 텍스트 문서 추가하기
    • 벡터 저장소에 파일 업로드하기
    • 벡터 저장소의 파일 내용 업데이트하기
    • 벡터 저장소에서 문서 제거하기
    • 의미적 유사성으로 벡터 저장소 문서 검색하기
  • 추가 자료
    • 공지사항
      • 이용 약관
      • 개인정보 처리방침
      • B2B
        • 레딧 에이전트에 대하여
  • 릴리스
    • 릴리스 노트 홈
  • 2025 릴리스
    • 2025년 4월 25일
    • 2025년 4월 18일
    • 2025년 4월 11일
    • 2025년 4월 4일
    • 2025년 3월 28일
    • 2025년 3월 21일
    • 2025년 3월 14일
    • 2025년 1월 17일
  • 2024 릴리스
    • 2024년 12월 27일
    • 2024년 12월 20일
    • 2024년 12월 13일
    • 2024년 12월 6일
  • 2024년 11월 29일
  • 2024년 11월 22일
  • 2024년 11월 15일
  • 2024년 11월 8일
  • 2024년 11월 1일
  • 2024년 10월 25일
  • 2024년 10월 18일
  • 2024년 10월 11일
  • 2024년 10월 4일
  • 2024년 9월 27일
  • 2024년 9월 20일
  • 2024년 9월 13일
  • 2024년 8월 16일
  • 2024년 8월 9일
  • 2024년 8월 2일
  • 2024년 7월 26일
  • 2024년 7월 12일
  • 2024년 6월 28일
  • 2024년 6월 14일
  • 2024년 5월 31일
  • 2024년 5월 17일
  • 2024년 5월 10일
  • 2024년 4월 26일
  • 2024년 4월 19일
  • 2024년 4월 12일
  • 2024년 4월 5일
  • 2024년 3월 25일
  • 2024년 3월 18일
  • 2024년 3월 11일
  • 2024년 3월 4일
  • 2024년 2월 26일
  • 2024년 2월 19일
  • 2024년 2월 12일
  • 2024년 2월 5일
  • 2024년 1월 29일
  • 2024년 1월 22일
  • 2024년 1월 15일
  • LLM 문서
    • Rememberizer LLM 준비 문서
Powered by GitBook
On this page
  1. 핵심 API

의미적 유사성으로 문서 검색

배치 처리 기능이 있는 의미 검색 엔드포인트

Previous인증Next문서 검색

Last updated 25 days ago

예제 요청

curl -X GET \
  "https://api.rememberizer.ai/api/v1/documents/search/?q=How%20to%20integrate%20Rememberizer%20with%20custom%20applications&n=5&from=2023-01-01T00:00:00Z&to=2023-12-31T23:59:59Z" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

YOUR_JWT_TOKEN을 실제 JWT 토큰으로 교체하세요.

const searchDocuments = async (query, numResults = 5, from = null, to = null) => {
  const url = new URL('https://api.rememberizer.ai/api/v1/documents/search/');
  url.searchParams.append('q', query);
  url.searchParams.append('n', numResults);
  
  if (from) {
    url.searchParams.append('from', from);
  }
  
  if (to) {
    url.searchParams.append('to', to);
  }
  
  const response = await fetch(url.toString(), {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN'
    }
  });
  
  const data = await response.json();
  console.log(data);
};

searchDocuments('How to integrate Rememberizer with custom applications', 5);

YOUR_JWT_TOKEN을 실제 JWT 토큰으로 교체하세요.

import requests

def search_documents(query, num_results=5, from_date=None, to_date=None):
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN"
    }
    
    params = {
        "q": query,
        "n": num_results
    }
    
    if from_date:
        params["from"] = from_date
    
    if to_date:
        params["to"] = to_date
    
    response = requests.get(
        "https://api.rememberizer.ai/api/v1/documents/search/",
        headers=headers,
        params=params
    )
    
    data = response.json()
    print(data)

search_documents("How to integrate Rememberizer with custom applications", 5)

YOUR_JWT_TOKEN을 실제 JWT 토큰으로 교체하세요.

require 'net/http'
require 'uri'
require 'json'

def search_documents(query, num_results=5, from_date=nil, to_date=nil)
  uri = URI('https://api.rememberizer.ai/api/v1/documents/search/')
  params = {
    q: query,
    n: num_results
  }
  
  params[:from] = from_date if from_date
  params[:to] = to_date if to_date
  
  uri.query = URI.encode_www_form(params)
  
  request = Net::HTTP::Get.new(uri)
  request['Authorization'] = 'Bearer YOUR_JWT_TOKEN'
  
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  
  response = http.request(request)
  data = JSON.parse(response.body)
  puts data
end

search_documents("How to integrate Rememberizer with custom applications", 5)

YOUR_JWT_TOKEN을 실제 JWT 토큰으로 교체하세요.

쿼리 매개변수

매개변수
유형
설명

q

문자열

필수. 검색 쿼리 텍스트(최대 400단어).

n

정수

반환할 결과 수. 기본값: 3. 더 포괄적인 결과를 위해 더 높은 값(예: 10)을 사용하세요.

from

문자열

검색할 문서의 시간 범위 시작, ISO 8601 형식.

to

문자열

검색할 문서의 시간 범위 종료, ISO 8601 형식.

prev_chunks

정수

문맥을 포함할 이전 청크 수. 기본값: 2.

next_chunks

정수

문맥을 포함할 다음 청크 수. 기본값: 2.

응답 형식

{
  "data_sources": [
    {
      "name": "Google Drive",
      "documents": 3
    },
    {
      "name": "Slack",
      "documents": 2
    }
  ],
  "matched_chunks": [
    {
      "document": {
        "id": 12345,
        "document_id": "1aBcD2efGhIjK3lMnOpQrStUvWxYz",
        "name": "Rememberizer API Documentation.pdf",
        "type": "application/pdf",
        "path": "/Documents/Rememberizer/API Documentation.pdf",
        "url": "https://drive.google.com/file/d/1aBcD2efGhIjK3lMnOpQrStUvWxYz/view",
        "size": 250000,
        "created_time": "2023-05-10T14:30:00Z",
        "modified_time": "2023-06-15T09:45:00Z",
        "indexed_on": "2023-06-15T10:30:00Z",
        "integration": {
          "id": 101,
          "integration_type": "google_drive"
        }
      },
      "matched_content": "Rememberizer를 사용자 정의 애플리케이션과 통합하려면 OAuth2 인증 흐름을 사용하여 애플리케이션이 사용자의 Rememberizer 데이터에 접근할 수 있도록 권한을 부여할 수 있습니다. 권한이 부여되면 애플리케이션은 Rememberizer API를 사용하여 문서를 검색하고, 콘텐츠를 검색하며, 그 외의 작업을 수행할 수 있습니다.",
      "distance": 0.123
    },
    // ... 더 많은 일치하는 청크
  ],
  "message": "검색이 성공적으로 완료되었습니다",
  "code": "success"
}

검색 최적화 팁

질문 답변을 위한

질문에 대한 답을 찾을 때, 쿼리를 이상적인 답변처럼 구성해 보세요. 예를 들어:

대신: "벡터 임베딩이란 무엇인가?" 시도해 보세요: "벡터 임베딩은 텍스트를 고차원 공간의 숫자 벡터로 변환하는 기술입니다."

결과 수 조정

  • 빠르고 높은 관련성의 결과를 위해 n=3으로 시작

  • 더 포괄적인 정보를 위해 n=10 이상으로 증가

  • 검색 결과가 불충분하면 n 매개변수를 증가시켜 보세요

시간 기반 필터링

from 및 to 매개변수를 사용하여 특정 기간의 문서에 집중하세요:

  • 최근 문서: from을 최근 날짜로 설정

  • 역사적 분석: 특정 날짜 범위를 지정

  • 오래된 정보 제외: 적절한 to 날짜 설정

배치 작업

대량의 검색 쿼리를 효율적으로 처리하기 위해 Rememberizer는 성능을 최적화하고 API 호출 오버헤드를 줄이기 위한 배치 작업을 지원합니다.

배치 검색

import requests
import time
import json
from concurrent.futures import ThreadPoolExecutor

def batch_search_documents(queries, num_results=5, batch_size=10):
    """
    여러 쿼리로 배치 검색 수행
    
    Args:
        queries: 검색 쿼리 문자열 목록
        num_results: 쿼리당 반환할 결과 수
        batch_size: 병렬로 처리할 쿼리 수
    
    Returns:
        각 쿼리에 대한 검색 결과 목록
    """
    headers = {
        "Authorization": "Bearer YOUR_JWT_TOKEN",
        "Content-Type": "application/json"
    }
    
    results = []
    
    # 쿼리를 배치로 처리
    for i in range(0, len(queries), batch_size):
        batch = queries[i:i+batch_size]
        
        # 요청을 병렬로 보내기 위한 스레드 풀 생성
        with ThreadPoolExecutor(max_workers=batch_size) as executor:
            futures = []
            
            for query in batch:
                params = {
                    "q": query,
                    "n": num_results
                }
                
                future = executor.submit(
                    requests.get,
                    "https://api.rememberizer.ai/api/v1/documents/search/",
                    headers=headers,
                    params=params
                )
                futures.append(future)
            
            # 완료되는 대로 결과 수집
            for future in futures:
                response = future.result()
                results.append(response.json())
        
        # 속도 제한 - API 제한을 피하기 위해 배치 사이에 일시 중지
        if i + batch_size < len(queries):
            time.sleep(1)
    
    return results

# 예제 사용법
queries = [
    "Rememberizer와 함께 OAuth 사용 방법",
    "벡터 데이터베이스 구성 옵션",
    "의미 기반 검색을 위한 모범 사례",
    # 필요에 따라 더 많은 쿼리 추가
]

results = batch_search_documents(queries, num_results=3, batch_size=5)
/**
 * 여러 쿼리로 배치 검색 수행
 * 
 * @param {string[]} queries - 검색 쿼리 문자열 목록
 * @param {number} numResults - 쿼리당 반환할 결과 수
 * @param {number} batchSize - 병렬로 처리할 쿼리 수
 * @param {number} delayBetweenBatches - 배치 간 대기할 밀리초
 * @returns {Promise<Array>} - 각 쿼리에 대한 검색 결과 목록
 */
async function batchSearchDocuments(queries, numResults = 5, batchSize = 10, delayBetweenBatches = 1000) {
  const results = [];
  
  // 배치로 쿼리 처리
  for (let i = 0; i < queries.length; i += batchSize) {
    const batch = queries.slice(i, i + batchSize);
    
    // 동시 요청을 위한 프로미스 배열 생성
    const batchPromises = batch.map(query => {
      const url = new URL('https://api.rememberizer.ai/api/v1/documents/search/');
      url.searchParams.append('q', query);
      url.searchParams.append('n', numResults);
      
      return fetch(url.toString(), {
        method: 'GET',
        headers: {
          'Authorization': 'Bearer YOUR_JWT_TOKEN'
        }
      }).then(response => response.json());
    });
    
    // 배치의 모든 요청이 완료될 때까지 대기
    const batchResults = await Promise.all(batchPromises);
    results.push(...batchResults);
    
    // 속도 제한 - API 제한을 피하기 위해 배치 간 일시 정지
    if (i + batchSize < queries.length) {
      await new Promise(resolve => setTimeout(resolve, delayBetweenBatches));
    }
  }
  
  return results;
}

// 예제 사용법
const queries = [
  "Rememberizer와 함께 OAuth 사용 방법",
  "벡터 데이터베이스 구성 옵션",
  "의미 기반 검색을 위한 모범 사례",
  // 필요에 따라 더 많은 쿼리 추가
];

batchSearchDocuments(queries, 3, 5)
  .then(results => console.log(results))
  .catch(error => console.error('배치 검색 중 오류 발생:', error));
require 'net/http'
require 'uri'
require 'json'
require 'concurrent'

# 여러 쿼리로 배치 검색 수행
#
# @param queries [Array<String>] 검색 쿼리 문자열 목록
# @param num_results [Integer] 쿼리당 반환할 결과 수
# @param batch_size [Integer] 병렬로 처리할 쿼리 수
# @param delay_between_batches [Float] 배치 간 대기할 초
# @return [Array] 각 쿼리에 대한 검색 결과 목록
def batch_search_documents(queries, num_results = 5, batch_size = 10, delay_between_batches = 1.0)
  results = []
  
  # 배치로 쿼리 처리
  queries.each_slice(batch_size).with_index do |batch, batch_index|
    # 동시 요청을 위한 스레드 풀 생성
    pool = Concurrent::FixedThreadPool.new(batch_size)
    futures = []
    
    batch.each do |query|
      futures << Concurrent::Future.execute(executor: pool) do
        uri = URI('https://api.rememberizer.ai/api/v1/documents/search/')
        params = {
          q: query,
          n: num_results
        }
        
        uri.query = URI.encode_www_form(params)
        
        request = Net::HTTP::Get.new(uri)
        request['Authorization'] = 'Bearer YOUR_JWT_TOKEN'
        
        http = Net::HTTP.new(uri.host, uri.port)
        http.use_ssl = true
        
        response = http.request(request)
        JSON.parse(response.body)
      end
    end
    
    # 모든 스레드에서 결과 수집
    batch_results = futures.map(&:value)
    results.concat(batch_results)
    
    # 속도 제한 - API 제한을 피하기 위해 배치 사이에 일시 중지
    if batch_index < (queries.length / batch_size.to_f).ceil - 1
      sleep(delay_between_batches)
    end
  end
  
  pool.shutdown
  results
end

# 예제 사용법
queries = [
  "Rememberizer와 함께 OAuth 사용 방법",
  "벡터 데이터베이스 구성 옵션",
  "의미 검색을 위한 모범 사례",
  # 필요에 따라 더 많은 쿼리 추가
]

results = batch_search_documents(queries, 3, 5)
puts results

성능 고려사항

배치 작업을 구현할 때 다음의 모범 사례를 고려하십시오:

  1. 최적의 배치 크기: 5-10 쿼리의 배치 크기로 시작하고 애플리케이션의 성능 특성에 따라 조정하십시오.

  2. 요금 제한: API 제한을 방지하기 위해 배치 간에 지연을 포함하십시오. 배치 간 1초가 좋은 시작점입니다.

  3. 오류 처리: 배치 내에서 실패한 요청을 관리하기 위해 강력한 오류 처리를 구현하십시오.

  4. 자원 관리: 특히 큰 배치 크기로 클라이언트 측 자원 사용을 모니터링하여 과도한 메모리 소비를 방지하십시오.

  5. 응답 처리: 가능한 경우 비동기적으로 배치 결과를 처리하여 사용자 경험을 개선하십시오.

대량의 애플리케이션의 경우, 많은 검색 요청을 효율적으로 관리하기 위해 큐 시스템을 구현하는 것을 고려하십시오.

이 엔드포인트는 전체 지식 기반에 걸쳐 강력한 의미 검색 기능을 제공합니다. 이는 의미에 따라 콘텐츠를 찾기 위해 벡터 임베딩을 사용하며, 정확한 키워드 일치가 아닙니다.

벡터 임베딩이 어떻게 작동하는지와 이 검색 접근 방식이 효과적인 이유에 대한 더 깊은 이해를 원하시면 를 참조하세요.

벡터 임베딩과 벡터 데이터베이스란 무엇인가?
get

Initiate a search operation with a query text of up to 400 words and receive the most semantically similar responses from the stored knowledge. For question-answering, convert your question into an ideal answer and submit it to receive similar real answers.

Query parameters
qstringOptional

Up to 400 words sentence for which you wish to find semantically similar chunks of knowledge.

nintegerOptional

Number of semantically similar chunks of text to return. Use 'n=3' for up to 5, and 'n=10' for more information. If you do not receive enough information, consider trying again with a larger 'n' value.

fromstring · date-timeOptional

Start of the time range for documents to be searched, in ISO 8601 format.

tostring · date-timeOptional

End of the time range for documents to be searched, in ISO 8601 format.

Responses
200
Successful retrieval of documents
application/json
400
Bad request
401
Unauthorized
404
Not found
500
Internal server error
get
GET /api/v1/documents/search/ HTTP/1.1
Host: api.rememberizer.ai
Accept: */*
{
  "data_sources": [
    {
      "name": "text",
      "documents": 1
    }
  ],
  "matched_chunks": [
    {
      "document": {
        "id": 18,
        "document_id": "text",
        "name": "text",
        "type": "text",
        "path": "text",
        "url": "text",
        "size": 1,
        "created_time": "2025-05-24T13:34:27.211Z",
        "modified_time": "2025-05-24T13:34:27.211Z",
        "indexed_on": "2025-05-24T13:34:27.211Z",
        "integration": {
          "id": 1,
          "integration_type": "text"
        }
      },
      "matched_content": "text",
      "distance": 1
    }
  ]
}
  • GET/documents/search/
  • 예제 요청
  • 쿼리 매개변수
  • 응답 형식
  • 검색 최적화 팁
  • 질문 답변을 위한
  • 결과 수 조정
  • 시간 기반 필터링
  • 배치 작업
  • 배치 검색
  • 성능 고려사항