IA

ilyestal/akyn-sdk

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

23 stars 5 forks 品質 74 トレンド 10MIT

Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.

概要

Build knowledge bases that AI assistants like Claude and Cursor can query directly. No infrastructure needed. This SDK lets you create MCP (Model Context Protocol) servers from any data source. Your docs, PDFs, websites, or any text can become a queryable knowledge base that AI assistants can access directly. - 📚 Make your documentation searchable by Cursor/Claude - 🔍 Build RAG (Retrieval-Augmented Generation) pipelines - 🤖 Create custom AI assistants with domain knowledge - 📖 Index research papers, guides, or any text content Add to ~/Library/Application Support/Claude/claude_desktop_config.json: Text is automatically split into optimal chunks for embedding: Uses OpenAI by default, but you can bring your own: Perfect for development and small datasets: For production workloads, use Qdrant - a high-performance vector database:

README

以下は原文 README の抜粋です。原文を見る。

akyn-ai

Turn any data source into an MCP server in 5 minutes.

Build knowledge bases that AI assistants like Claude and Cursor can query directly. No infrastructure needed.


What is this?

This SDK lets you create MCP (Model Context Protocol) servers from any data source. Your docs, PDFs, websites, or any text can become a queryable knowledge base that AI assistants can access directly.

Use cases:

  • 📚 Make your documentation searchable by Cursor/Claude
  • 🔍 Build RAG (Retrieval-Augmented Generation) pipelines
  • 🤖 Create custom AI assistants with domain knowledge
  • 📖 Index research papers, guides, or any text content

Quick Start

Install

npm install akyn-ai

Basic Usage

import { KnowledgeBase } from 'akyn-ai'

// Create a knowledge base
const kb = new KnowledgeBase({
  name: 'my-docs',
  description: 'My project documentation',
})

// Add your content
await kb.addDirectory('./docs')           // Add all docs from a folder
await kb.addFile('./README.md')           // Add a specific file
await kb.addURL('https://docs.example.com') // Scrape a URL
await kb.addText('Important info here')   // Add raw text

// Serve as MCP server
kb.serveStdio()  // For Cursor/Claude Desktop

Connect to Cursor

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "my-docs": {
      "command": "npx",
      "args": ["ts-node", "./my-kb.ts"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Connect to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "my-docs": {
      "command": "npx",
      "args": ["ts-node", "/path/to/my-kb.ts"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Features

📁 Multi-Source Ingestion

// Files (PDF, DOCX, TXT, Markdown)
await kb.addFile('./guide.pdf')
await kb.addFile('./manual.docx')

// Directories (recursive)
await kb.addDirectory('./docs', {
  recursive: true,
  extensions: ['.md', '.txt', '.pdf'],
})

// URLs
await kb.addURL('https://docs.example.com')
await kb.addURLs([
  'https://example.com/page1',
  'https://example.com/page2',
])

// Raw text
await kb.addText('Custom content here', 'My Notes')

🔍 Smart Chunking

Text is automatically split into optimal chunks for embedding:

const kb = new KnowledgeBase({
  name: 'my-kb',
  chunking: {
    maxSize: 1000,    // Max characters per chunk
    overlap: 200,     // Overlap between chunks for context
  },
})

🧠 Flexible Embeddings

Uses OpenAI by default, but you can bring your own:

import { KnowledgeBase, type EmbeddingsProvider } from 'akyn-ai'
GitHub で README 全文を見る

インストール

npx ts-node ./my-kb.ts
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "my-docs": { "command": "npx", "args": ["ts-node", "./my-kb.ts"], "env": { "OPENAI_API_KEY": "sk-..." } } } }