현대적 코드를 위한 고대의 지식 수호자
AI 어시스턴트를 위한 98% 토큰 감소 (token reduction) 기능을 갖춘 시맨틱 검색 (Semantic search).
내 워크플로우에서 AI 컨텍스트 사용량(및 비용)을 98% 줄인 방법 / How I reduced AI context usage (and costs) by 98% in my workflow https://www.tabnews.com.br/S1LV4/como-reduzi-em-98-por-cento-o-uso-de-contexto-e-os-custos-de-ia-no-meu-workflow
curl -fsSL https://raw.githubusercontent.com/S1LV4/th0th/main/install.sh | bash
대화형으로 설치됩니다. 세 가지 모드가 있습니다:
| 모드 | 요구 사항 | 최적의 용도 |
|---|
| Docker (기본값) | Docker | 프로덕션 (Production), 빠른 시작 |
| Docker build | Docker + Git | 커스텀 빌드, 로컬 변경 사항 |
| Source | Git + Bun | 개발, 기여자 |
비대화형 (CI/스크립트 방식):
# Docker 모드, 커스텀 포트, 시작 건너뛰기
TH0TH_MODE=docker TH0TH_API_PORT=4000 TH0TH_NO_START=1 \
curl -fsSL https://raw.githubusercontent.com/S1LV4/th0th/main/install.sh | bash
# 1. 클론(Clone) 및 설치
git clone https://github.com/S1LV4/th0th.git
cd th0th
...
확인: curl http://localhost:3333/health
팁: 언제든지 bun run diagnose를 실행하여 Ollama 연결성, 데이터베이스 접근, 임베딩 생성 (embedding generation) 및 마이그레이션 (migration) 상태를 검증할 수 있습니다.
파일: ~/.config/opencode/opencode.json
MCP 패키지를 통해:
{
"mcp": {
"th0th": {
...
플러그인 (Plugin)을 통해:
{
"plugin": ["@th0th-ai/opencode-plugin"]
}
소스로부터 (개발용):
{
"mcpServers": {
"th0th": {
...
워크스페이스에 .vscode/mcp.json을 생성하세요:
{
"servers": {
"th0th": {
...
또는 자동 설정을 위해 ./scripts/setup-vscode.sh를 실행하세요.
{
"mcpServers": {
"th0th": {
...
| 도구 (Tool) | 설명 (Description) |
|---|
th0th_index | 시맨틱 검색 (Semantic search)을 위해 프로젝트 디렉토리를 인덱싱 (Index) |
th0th_search | 필터를 사용한 시맨틱 (Semantic) + 키워드 (Keyword) 검색 |
th0th_remember | 중요한 정보를 영구 메모리 (Persistent memory)에 저장 |
th0th_recall | 이전 세션에서 저장된 메모리 검색 |
th0th_compress | 컨텍스트 (Context) 압축 (구조는 유지하고 세부 사항은 제거) |
th0th_optimized_context | 한 번의 호출로 검색 + 압축 수행 (최대 토큰 효율성) |
th0th_analytics | 사용 패턴, 캐시 성능, 메트릭 (Metrics) |
# 개발 (Development)
bun run dev:api
# 운영 (Production)
...
Swagger 문서: http://localhost:3333/swagger
# 프로젝트 인덱싱 (Index a project)
curl -X POST http://localhost:3333/api/v1/project/index \
-H "Content-Type: application/json" \
...
설정 파일 (Config file): ~/.config/th0th/config.json
(첫 실행 시 자동 생성됨)
# 현재 설정 표시
npx @th0th-ai/mcp-client --config-show
# 설정 파일 경로 표시
...
| 제공자 (Provider) | 모델 (Model) | 비용 (Cost) | 품질 (Quality) |
|---|
| Ollama (기본값) | qwen3-embedding, bge-m3, nomic-embed-text | 무료 (Free) | 좋음-매우 좋음 (Good-Excellent) |
| Mistral | mistral-embed, codestral-embed | $$ | 매우 좋음 (Great) |
| OpenAI | text-embedding-3-small | $$ | 매우 좋음 (Great) |
상세한 설정 관리(Configuration management)를 위해 설정 CLI를 사용하세요:
# 특정 제공자로 초기화
npx @th0th-ai/mcp-client --config-init # Ollama (기본값)
npx @th0th-ai/mcp-client --config-init --mistral your-api-key # Mistral
...
| 명령 (Command) | 설명 (Description) |
|---|
bun run build | 모든 패키지 빌드 (Build) |
bun run dev | 개발 (Development) (모든 앱) |
bun run dev:api | 핫 리로드 (Hot reload) 기능이 포함된 REST API |
bun run dev:mcp | 워치 (Watch) 기능이 포함된 MCP 서버 |
bun run start:api | REST API 시작 |
bun run start:mcp | MCP 서버 시작 |
bun run test | 테스트 실행 |
bun run lint | 코드 린트 (Lint) |
bun run type-check | 타입 체크 (Type checking) |
bun run diagnose | 전체 스택 검증 (Ollama, 데이터베이스, 임베딩 (Embeddings)) |
th0th/
├── apps/
│ ├── mcp-client/ # MCP 서버 (stdio)
...
| 구성 요소 | 설명 |
|---|
| 시맨틱 검색 (Semantic Search) | RRF 랭킹 (RRF ranking)을 적용한 하이브리드 벡터 (Hybrid vector) + 키워드 |
| 임베딩 (Embeddings) | Ollama (로컬) 또는 Mistral/OpenAI API |
| 압축 (Compression) | 규칙 기반 코드 구조 추출 (70-98% 감소) |
| 메모리 (Memory) | 세션 간 지속되는 SQLite 저장소 |
| 캐시 (Cache) | TTL이 적용된 다단계 L1/L2 |
MIT