AI-powered semantic code search with intelligent parsing for Python projects
Project description
CodeSense
AI-powered semantic code search for Python projects. Auto-detects Django, FastAPI, Flask and understands natural language queries.
Key Features
- Smart Search - Natural language queries with auto-intent detection
- Framework Support - Auto-detects Django, FastAPI, Flask patterns
- Python API - Use programmatically in your code
- Fast & Local - FAISS-powered search, all data stored locally
- Incremental Updates - Update only changed files, 10x faster
- Chunk-based - Search functions, classes, methods separately
Installation
pip install codesense
From source:
git clone https://github.com/steliarix/codesense.git
cd codesense
pip install -e .
See Installation Guide for details.
Quick Start
CLI
# Index your project
codesense index ~/projects/my-app --name my_app
# Search with natural language
codesense search "user authentication" --index my_app
# Update after code changes
codesense update my_app
Python API
from codesense import CodeSense
cs = CodeSense(index_name="my_project")
cs.index("/path/to/project")
results = cs.search("user authentication", top_k=5)
for result in results:
print(f"{result.file_path}:{result.start_line}")
Documentation
- Installation - Installation methods and setup
- CLI Usage - Command reference and options
- Python API - API reference and methods
- Examples - Real-world usage examples
How It Works
- Index - Parse Python files using AST, extract code chunks
- Embed - Create semantic embeddings with sentence-transformers
- Search - Find similar code using FAISS vector similarity
CodeSense understands concepts, not just keywords:
- "verify user identity" → finds authentication code
- "product model" → finds only Django/Pydantic models
- "api endpoint" → finds FastAPI/Flask routes
Technologies
- sentence-transformers - Semantic embeddings
- FAISS - Vector search
- Click - CLI framework
Roadmap
- ✅ v0.4 - Universal framework support + Python API
- ✅ v0.3 - Incremental updates
- ✅ v0.2 - Chunk-based parsing
- 🔜 v0.6 - MCP integration for AI tools
- 🔜 v0.7 - Multi-language support (JS, TypeScript, Java)
See CHANGELOG.md for full version history.
Requirements
- Python 3.9+
- 1GB RAM (for embedding model)
- ~1-5 MB storage per 100 indexed files
License
MIT License - see LICENSE for details.
Links
Author: Artem | Version: 0.4.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codesense-0.4.0.tar.gz.
File metadata
- Download URL: codesense-0.4.0.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
897bed43202f33c93fd8b205d1ae0a9701c93b8734aa0e9233037852f2423796
|
|
| MD5 |
634a82210a15fb8caab67d82cd21bf0d
|
|
| BLAKE2b-256 |
42d2957bc22bc4a81254dbabfb8a3d26bbaf4a7b8413a78d0f38277486841c9f
|
File details
Details for the file codesense-0.4.0-py3-none-any.whl.
File metadata
- Download URL: codesense-0.4.0-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5408a948e4bfaa05550bddaa8d4794a8dbbd4b3c66cbbef158eee1a0a577614f
|
|
| MD5 |
363e94f034aa8383a95365de78331860
|
|
| BLAKE2b-256 |
c2d7c1dcb7dfd4196e5dff5be9f4849199d4899d3b8a6b099dcb63f0419e0f99
|