Indexing Your Codebase Into Live Documentation for AI
Summary
The `code-vector-graph` project offers a solution for AI assistants to access live, searchable code documentation by indexing JavaScript and TypeScript repositories. It addresses the limitations of traditional keyword search and pure vector search by combining a Qdrant vector database for semantic search over code chunks with a Neo4j graph database for structural relationships between files, classes, functions, and imports. This hybrid approach allows AI to understand both "what code is semantically related" and "how this code is connected." The system supports HuggingFace embedding models like Nomic (3584-dimensional) and Jina (1536-dimensional) and exposes a Model Context Protocol (MCP) server, enabling AI tools to query the indexed repository directly for grounded answers.
Key takeaway
For AI Engineers or ML Engineers integrating AI assistants into development workflows, implementing `code-vector-graph` can transform your codebase into a continuously updated, searchable knowledge base. This enables AI assistants to ground answers in live code, significantly improving accuracy and accelerating development and onboarding. Consider integrating the Model Context Protocol (MCP) server for direct, structured AI access to your repository's context.
Key insights
The `code-vector-graph` project creates live, searchable code documentation for AI by combining vector and graph databases.
Principles
- Code documentation decays when separate from source.
- AI needs both semantic and structural code context.
- Hybrid retrieval improves AI's understanding of code.
Method
The pipeline scans, parses, chunks, embeds into Qdrant, extracts graph entities, and stores them in Neo4j, then exposes via an MCP server.
In practice
- Index JavaScript/TypeScript repos with `code-vector-graph`.
- Use Nomic or Jina for code embeddings.
- Add `glossary.yml` or JSDoc for human context.
Topics
- Code Indexing
- Vector Databases
- Graph Databases
- AI-Assisted Development
- Semantic Search
- Code Documentation
- Model Context Protocol
Code references
Best for: AI Engineer, Machine Learning Engineer, AI Architect
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence in Plain English - Medium.