|
|
3 місяців тому | |
|---|---|---|
| example-docs | 3 місяців тому | |
| src | 3 місяців тому | |
| .env.example | 3 місяців тому | |
| .gitignore | 3 місяців тому | |
| AGENTIC_CODER_CONFIG.md | 3 місяців тому | |
| IMPLEMENTATION_COMPLETE.md | 3 місяців тому | |
| MCP_CLIENTS.md | 3 місяців тому | |
| README.md | 3 місяців тому | |
| package-lock.json | 3 місяців тому | |
| package.json | 3 місяців тому | |
| tsconfig.json | 3 місяців тому |
A comprehensive TypeScript-based project for storing markdown documents in Qdrant vector database with Ollama embeddings, plus a powerful source code documentation parser. Includes both CLI tools and MCP server integration.
/** */, ///, //!) and tags (@brief, @param, @return, @example)npm install
Copy .env.example to .env and configure your settings:
# Qdrant URL Configuration
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=
# Ollama Configuration
OLLAMA_URL=http://localhost:11434
OLLAMA_EMBEDDING_MODEL=nomic-embed-text
npm run build
npm run dev add --name "my-docs" --folder "./docs" --recursive
npm run dev search --document "my-docs" --query "installation guide" --limit 5
npm run dev list
npm run dev info --document "my-docs"
npm run parse --input "./src" --output "./docs" --languages cpp
npm run parse-list-languages
npm run parse-validate --input "./src"
npm run parse --input "./src" --output "./docs" --dry-run
Collections are stored as vectors in Qdrant with metadata for retrieval.
The parser generates structured documentation:
docs/
├── index.md # Main index with package references
└── Calculator/
├── index.md # Module overview
├── Calculator.md # Class documentation
├── add.md # Method documentation
└── multiply.md # Method documentation
Start the MCP server:
npm run mcp:cli
Or use the dedicated CLI:
docs-rag-mcp
For MCP clients, use this configuration:
{
"mcpServers": {
"docs-rag": {
"command": "npx",
"args": ["-y", "docs-rag-mcp"],
"cwd": "/path/to/docs-rag"
}
}
}
add_document - Add a document collection from markdown files
name (string), folder (string), recursive (boolean, default: true)
search_documents - Search within a document collection
documentName (string), query (string), limit (number, default: 10)
list_collections - List all document collections
get_document_info - Get information about a document collection
documentName (string)src/
├── config/ # Configuration management
├── lib/
│ ├── parser/ # Source code parser library
│ │ ├── core/ # Core interfaces and generators
│ │ ├── parsers/ # Language-specific parsers
│ │ └── utils/ # File and markdown utilities
│ └── fileProcessor.ts # Utility functions (file processing)
├── services/ # Core services
│ ├── documentService.ts # Document management
│ ├── parseService.ts # Source code parser
│ ├── ollamaService.ts # Embedding generation
│ └── qdrantService.ts # Qdrant client
├── cli/ # CLI tool implementation
│ ├── index.ts # Main CLI with all commands
│ └── parser-commands.ts # Parser-specific commands
├── mcp/ # MCP server implementation
│ ├── server.ts # MCP server
│ ├── stdio.ts # stdio transport
│ ├── agentic-stdio.ts # Agentic stdio
│ └── cli.ts # CLI interface
└── types/ # Type definitions
└── parser-types.ts # Parser type definitions
/** */, ///, and //! documentation styles@brief, @param, @return, @example tags@qdrant/qdrant-js - Qdrant client@modelcontextprotocol/sdk - MCP server frameworkcommander - CLI frameworkollama - Embedding generationdotenv - Environment configurationfs-extra - Enhanced file system operationscrypto - Hash generationglob - File pattern matchingtypescript - TypeScript support and compilationtsx - TypeScript execution runtimezod - Type validation and schemasThe parser is designed to be extensible:
ILanguageParser interfaceDocumentationGenerator output formatSee src/lib/parser/parsers/base-parser.ts for the base class structure.