Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

document-chat-interface

БесплатноЗапускает вложенные скриптыНе проверен

Build chat interfaces for querying documents using natural language. Extract information from PDFs, GitHub repositories, emails, and other sources. Use when…

qodex-aiот qodex-ai★ 50 звёзд на GitHub

Об этом скилле

Document Chat Interface

Build intelligent chat interfaces that allow users to query and interact with documents using natural language, transforming static documents into interactive knowledge sources.

Overview

A document chat interface combines three capabilities:

  1. Document Processing - Extract and prepare documents
  2. Semantic Understanding - Understand questions and find relevant content
  3. Conversational Interface - Maintain context and provide natural responses

Common Applications

  • PDF Q&A: Answer questions about research papers, reports, books
  • Email Search: Find information in email archives conversationally
  • GitHub Explorer: Ask questions about code repositories
  • Knowledge Base: Interactive access to company documentation
  • Contract Review: Query legal documents with natural language
  • Research Assistant: Explore academic papers interactively

Architecture

Document Source
    ↓
Document Processor
    ├→ Extract text
    ├→ Process content
    └→ Generate embeddings
    ↓
Vector Database
    ↓
Chat Interface ← User Question
    ├→ Retrieve relevant content
    ├→ Maintain conversation history
    └→ Generate response

Core Components

1. Document Sources

See examples/document_processors.py for implementations:

PDF Documents

  • Extract text from PDF pages
  • Preserve document structure and metadata
  • Handle scanned PDFs with OCR (pytesseract)
  • Extract tables (pdfplumber)

GitHub Repositories

  • Extract code files from repositories
  • Parse repository structure
  • Process multiple file types

Email Archives

  • Extract email metadata (from, to, subject, date)
  • Parse email body content
  • Handle multiple mailbox formats

Web Pages

  • Extract page text and structure
  • Preserve heading hierarchy
  • Extract links and navigation

YouTube/Audio

  • Get transcripts from YouTube videos
  • Transcribe audio files
  • Handle multiple formats

2. Document Processing

See examples/text_processor.py for implementations:

Text Extraction & Cleaning

  • Remove extra whitespace and special characters
  • Smart text chunking with overlap
  • Intelligent sentence boundary detection

Metadata Extraction

  • Extract title, author, date, language
  • Calculate word count and document statistics
  • Track document source and format

Structure Preservation

  • Keep heading hierarchy in chunks
  • Preserve section context
  • Enable hierarchical retrieval

3. Chat Interface Design

See examples/conversation_manager.py for implementations:

Conversation Management

  • Maintain conversation history with size limits
  • Track message metadata (timestamps, roles)
  • Provide context for LLM integration
  • Clear history as needed

Question Refinement

  • Expand implicit references in questions
  • Handle pronouns and context references
  • Improve question clarity with previous context

Response Generation

  • Use document context for answering
  • Maintain conversation history in prompts
  • Provide source citations
  • Handle out-of-scope questions

4. User Experience Features

Citation & Sources

def format_response_with_citations(response: str, sources: List[Dict]) -> str:
    """Add source citations to response"""

    formatted = response + "\n\n**Sources:**\n"
    for i, source in enumerate(sources, 1):
        formatted += f"[{i}] Page {source['page']} of {source['source']}\n"
        if 'excerpt' in source:
            formatted += f"    \"{source['excerpt'][:100]}...\"\n"

    return formatted

Clarifying Questions

def generate_follow_up_questions(context: str, response: str) -> List[str]:
    """Suggest follow-up questions to user"""

    prompt = f"""
    Based on this Q&A, generate 3 relevant follow-up questions:
    Context: {context[:500]}
    Response: {response[:500]}
    """

    follow_ups = llm.generate(prompt)
    return follow_ups

Error Handling

def handle_query_failure(question: str, error: Exception) -> str:
    """Handle when no relevant documents found"""

    if isinstance(error, NoRelevantDocuments):
        return (
            "I couldn't find information about that in the documents. "
            "Try asking about different topics like: "
            + ", ".join(get_main_topics())
        )
    elif isinstance(error, ContextTooLarge):
        return (
            "The answer requires too much context. "
            "Can you be more specific about what you'd like to know?"
        )
    else:
        return f"I encountered an issue: {str(error)[:100]}"

Implementation Frameworks

Using LangChain

from langchain.document_loaders import PDFLoader
from langchain.text_splitter import CharacterTextSplitter
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.chat_models import ChatOpenAI
from
Полный SKILL.md на GitHub

Установить document-chat-interface в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/conversation_manager.pyexamples/document_processors.pyexamples/text_processor.py

FAQ

Что делает скилл document-chat-interface?

Build chat interfaces for querying documents using natural language. Extract information from PDFs, GitHub repositories, emails, and other sources. Use when creating interactive document Q&A systems, knowledge base chatbots, email search interfaces, or document exploration tools.

Как установить скилл document-chat-interface?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл document-chat-interface запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить document-chat-interface с