Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions context7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://context7.com/schema.json",
"name": "CodeRAG",
"description": "Lightning-fast semantic code search with AST chunking - RAG-ready for AI assistants",
"repository": "https://github.com/SylphxAI/coderag",
"documentation": "https://coderag.sylphx.com",
"npm": "@sylphx/coderag",
"rules": [
"Always use PersistentStorage for production - it provides SQLite persistence and instant startup",
"Use async parseAsync() not sync parse() - WASM parsers require async initialization",
"Import from subpaths when possible: '@sylphx/coderag/storage', '@sylphx/coderag/tfidf'",
"Set lowMemoryMode: true for codebases over 10,000 files to use SQL-based search",
"Use hybridSearch() for best results when OPENAI_API_KEY is set, otherwise use indexer.search()",
"File watching requires await indexer.index({ watch: true }) - don't forget await",
"SearchResult.snippet contains formatted code with line numbers, chunkType indicates the AST node type",
"StarCoder2 tokenizer downloads on first use (~4.7MB) - pre-initialize with initializeTokenizer()",
"Synth parsers are optional dependencies - they install automatically when needed"
],
"folders": [
{
"path": "docs",
"description": "VitePress documentation site"
},
{
"path": "packages/core/src",
"description": "Core library source code"
},
{
"path": "packages/mcp-server/src",
"description": "MCP server implementation"
}
],
"excludeFolders": [
"node_modules",
"dist",
".vitepress/dist",
".vitepress/cache",
".turbo",
".git"
],
"examples": [
{
"title": "Basic Usage",
"code": "import { CodebaseIndexer, PersistentStorage } from '@sylphx/coderag'\n\nconst storage = new PersistentStorage({ codebaseRoot: '.' })\nconst indexer = new CodebaseIndexer({ codebaseRoot: '.', storage })\n\nawait indexer.index()\nconst results = await indexer.search('authentication')"
},
{
"title": "Hybrid Search",
"code": "import { CodebaseIndexer, PersistentStorage, createEmbeddingProvider, hybridSearch } from '@sylphx/coderag'\n\nconst embeddingProvider = await createEmbeddingProvider({ provider: 'openai' })\nconst storage = new PersistentStorage({ codebaseRoot: '.' })\nconst indexer = new CodebaseIndexer({ codebaseRoot: '.', storage, embeddingProvider })\n\nawait indexer.index()\nconst results = await hybridSearch('user login flow', indexer, { vectorWeight: 0.7 })"
},
{
"title": "MCP Server",
"code": "npx @sylphx/coderag-mcp --root=/path/to/project"
}
]
}
121 changes: 104 additions & 17 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,106 @@
import { defineConfig } from 'vitepress'

const title = 'CodeRAG'
const description =
'Lightning-fast semantic code search with AST chunking - RAG-ready for AI assistants'
const url = 'https://coderag.sylphx.com'
const ogImage = `${url}/og-image.png`

export default defineConfig({
title: 'CodeRAG',
description: 'Lightning-fast hybrid code search (TF-IDF + Vector) - RAG-ready for AI assistants',
title,
description,
base: '/',
cleanUrls: true,
ignoreDeadLinks: true,
lastUpdated: true,

head: [
// Favicon
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
['link', { rel: 'icon', type: 'image/png', href: '/favicon.png' }],

// SEO
['meta', { name: 'theme-color', content: '#6366f1' }],
['meta', { name: 'author', content: 'Sylphx' }],
[
'meta',
{
name: 'keywords',
content:
'code search, RAG, retrieval augmented generation, TF-IDF, BM25, vector search, embeddings, AST, semantic search, MCP, AI assistant',
},
],

// Open Graph
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: title }],
['meta', { property: 'og:description', content: description }],
['meta', { property: 'og:url', content: url }],
['meta', { property: 'og:image', content: ogImage }],
['meta', { property: 'og:image:width', content: '1200' }],
['meta', { property: 'og:image:height', content: '630' }],
['meta', { property: 'og:site_name', content: 'CodeRAG' }],
['meta', { property: 'og:locale', content: 'en_US' }],

// Twitter Card
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:title', content: title }],
['meta', { name: 'twitter:description', content: description }],
['meta', { name: 'twitter:image', content: ogImage }],
['meta', { name: 'twitter:site', content: '@SylphxAI' }],

// Canonical
['link', { rel: 'canonical', href: url }],
],

sitemap: {
hostname: url,
},

themeConfig: {
logo: '/logo.svg',
siteTitle: 'CodeRAG',

nav: [
{ text: 'Guide', link: '/guide/getting-started' },
{ text: 'API', link: '/api/core' },
{ text: 'API', link: '/api/overview' },
{ text: 'MCP Server', link: '/mcp/overview' },
{ text: 'GitHub', link: 'https://github.com/sylphlab/coderag' },
{
text: 'Resources',
items: [
{ text: 'GitHub', link: 'https://github.com/SylphxAI/coderag' },
{ text: 'npm', link: 'https://www.npmjs.com/package/@sylphx/coderag' },
{ text: 'Changelog', link: 'https://github.com/SylphxAI/coderag/releases' },
],
},
],

sidebar: {
'/guide/': [
{
text: 'Introduction',
items: [
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'What is CodeRAG?', link: '/guide/getting-started' },
{ text: 'Installation', link: '/guide/installation' },
{ text: 'Quick Start', link: '/guide/quick-start' },
],
},
{
text: 'Core Concepts',
items: [
{ text: 'TF-IDF Search', link: '/guide/tfidf' },
{ text: 'How Search Works', link: '/guide/how-search-works' },
{ text: 'AST Chunking', link: '/guide/ast-chunking' },
{ text: 'TF-IDF & BM25', link: '/guide/tfidf' },
{ text: 'Vector Search', link: '/guide/vector-search' },
{ text: 'Hybrid Search', link: '/guide/hybrid-search' },
{ text: 'Code Tokenization', link: '/guide/tokenization' },
],
},
{
text: 'Configuration',
text: 'Advanced',
items: [
{ text: 'Embedding Providers', link: '/guide/providers' },
{ text: 'Custom Providers', link: '/guide/custom-providers' },
{ text: 'Persistent Storage', link: '/guide/storage' },
{ text: 'File Watching', link: '/guide/file-watching' },
{ text: 'Language Support', link: '/guide/languages' },
{ text: 'Performance Tuning', link: '/guide/performance' },
],
},
Expand All @@ -48,10 +109,13 @@ export default defineConfig({
{
text: 'API Reference',
items: [
{ text: 'Core Package', link: '/api/core' },
{ text: 'Embeddings', link: '/api/embeddings' },
{ text: 'Search', link: '/api/search' },
{ text: 'Storage', link: '/api/storage' },
{ text: 'Overview', link: '/api/overview' },
{ text: 'CodebaseIndexer', link: '/api/indexer' },
{ text: 'PersistentStorage', link: '/api/storage' },
{ text: 'Search Functions', link: '/api/search' },
{ text: 'Embedding Providers', link: '/api/embeddings' },
{ text: 'AST Chunking', link: '/api/chunking' },
{ text: 'Types', link: '/api/types' },
],
},
],
Expand All @@ -61,22 +125,45 @@ export default defineConfig({
items: [
{ text: 'Overview', link: '/mcp/overview' },
{ text: 'Installation', link: '/mcp/installation' },
{ text: 'Tools', link: '/mcp/tools' },
{ text: 'Configuration', link: '/mcp/configuration' },
{ text: 'Tools Reference', link: '/mcp/tools' },
{ text: 'IDE Integration', link: '/mcp/ide-integration' },
],
},
],
},

socialLinks: [{ icon: 'github', link: 'https://github.com/sylphlab/coderag' }],
socialLinks: [
{ icon: 'github', link: 'https://github.com/SylphxAI/coderag' },
{ icon: 'npm', link: 'https://www.npmjs.com/package/@sylphx/coderag' },
],

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2024 SylphLab',
copyright: 'Copyright © 2024 Sylphx',
},

search: {
provider: 'local',
options: {
detailedView: true,
},
},

editLink: {
pattern: 'https://github.com/SylphxAI/coderag/edit/main/docs/:path',
text: 'Edit this page on GitHub',
},

outline: {
level: [2, 3],
},

lastUpdated: {
text: 'Last updated',
formatOptions: {
dateStyle: 'medium',
},
},
},

Expand Down
Loading
Loading