
ilyestal/akyn-sdk
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
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'
Установка
npx ts-node ./my-kb.tsКонфигурация
{
"mcpServers": {
"my-docs": {
"command": "npx",
"args": ["ts-node", "./my-kb.ts"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}