A Python-based code indexing engine similar to Cursor, designed to transform Git repository code into code snippets with semantic embeddings for intelligent code search and retrieval.
- Code Snippet Generation: Automatically processes Git repositories and converts code into searchable snippets
- Semantic Search: Generates semantic embeddings for intelligent code retrieval based on user queries
- Multi-Language Support: Optimized for Python, Java, Go, JavaScript, and TypeScript
- Flexible Backends: Supports multiple vector database backends and embedding service providers
- MCP Integration: Built-in support for MCP (Model Context Protocol) service calls
- Deployment Ready: Flexible deployment options for different environments
- Python 3.12+
- Git
# Clone the repository
git clone https://github.com/we0-dev/we0-index
cd we0-index
# Set up environment configuration
cp .env.example .env
vim .env
# Configure application settings
vim resource/dev.yaml
# Create virtual environment and install dependencies
uv venv
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
uv sync# Install development dependencies
uv sync --frozen- Environment Variables: Copy
.env.exampleto.envand configure your settings - Application Config: Edit
resource/dev.yamlto customize your deployment - Vector Database: Configure your preferred vector database backend
- Embedding Service: Set up your embedding service provider
We0-index supports two running modes: Web API service and MCP protocol service.
Start the FastAPI web server to provide RESTful API endpoints:
# Activate virtual environment
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
# Start web service
python main.py --mode fastapiThe web service will start on the configured host and port (check resource/dev.yaml for default configuration).
Start the MCP (Model Context Protocol) service for AI integration:
# Activate virtual environment
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
# Start MCP service (default with streamable-http transport)
python main.py --mode mcp
# Specify other transport protocols
python main.py --mode mcp --transport stdio
python main.py --mode mcp --transport sseThe MCP service runs with streamable-http transport by default and can be integrated with MCP-compatible AI clients.
Mode Parameters:
--mode fastapi: Start Web API service--mode mcp: Start MCP protocol service
Transport Parameters (only applicable for MCP mode):
--transport streamable-http: Use HTTP streaming transport (default)--transport stdio: Use standard input/output transport--transport sse: Use sse transport
We0-index is built with a modular architecture supporting:
- Code Parsers: Language-specific code parsing and snippet extraction
- Embedding Engines: Multiple embedding service integrations
- Vector Stores: Pluggable vector database backends
- Search Interface: RESTful API and CLI for code search
- MCP Protocol: Model Context Protocol for AI integration
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For detailed documentation, please visit our Documentation Site or check the docs/ directory.
If you encounter any issues, please create an issue on GitHub.
- 📧 Email: we0@wegc.cn
- 💬 Discussions: GitHub Discussions
- 📖 Wiki: Project Wiki
- Thanks to all contributors who have helped make this project better
- Inspired by Cursor's approach to code intelligence
- Built with modern Python tooling and best practices
Made with ❤️ by the We0-dev Team