r/Python • u/Ambitious-Credit-722 • Mar 09 '26
Discussion I built a semantic code search engine in Python — would love your thoughts
CodexA is a CLI-first developer intelligence engine that lets you search codebases by meaning, not just keywords. You type codex search "authentication middleware" and it finds relevant code even if it's named verify_token_handler — using sentence-transformers for embeddings and FAISS for vector search.
Beyond search, it includes:
36 CLI commands covering quality analysis (Radon), security scanning (Bandit), hotspot detection, call graph extraction, and blast-radius impact analysis
Tree-sitter AST parsing for 12 languages (Python, TypeScript, Rust, Go, Java, C/C++, etc.)
8 structured AI agent tools accessible via MCP, HTTP bridge, or CLI — works directly with Copilot, Claude, and Cursor
A plugin system with 22 hook points for extending any part of the pipeline
A self-improving evolution engine that can discover issues, generate patches, run tests, and commit fixes autonomously
Web UI, REST API, TUI, LSP server — all sharing the same tool protocol
It runs 100% offline, needs no API keys, and has 2595+ tests.
GitHub: github.com/M9nx/CodexA
Docs: codex-a.dev
MIT License, Python 3.11+
Target Audience
This is meant for production use by:
Developers working in large or unfamiliar codebases who want to find code by what it does, not what it's named
AI agent builders who need structured code search and analysis tools (via MCP or HTTP)
Teams that want automated quality gates, impact analysis, and hotspot detection in CI/CD
Solo developers who want IDE-level code intelligence from the terminal
It's not a toy project — it's actively maintained with 2595+ tests and a 70% coverage gate.
Comparison
vs. grep/ripgrep: grep matches text patterns. CodexA understands code semantics — it finds related code even when terminology differs. It also bundles quality analysis, impact analysis, and AI agent integration that grep doesn't touch.
vs. Sourcegraph/GitHub code search: Those are cloud-hosted services. CodexA runs entirely offline on your machine. No code ever leaves your environment, no subscriptions needed.
vs. IDE search (VS Code, JetBrains): IDE search is symbol-based and limited to the editor. CodexA is scriptable, works from the terminal, supports
--jsonoutput for automation, and exposes tools for AI agents. It also adds quality/security analysis that IDEs don't do natively.vs. aider/continue: Those are AI coding assistants. CodexA is the search and analysis infrastructure that AI assistants can plug into — it provides the structured tools they call, not the chat interface itself.
I'd genuinely love feedback — what would make this more useful to you? What's missing? Contributors are also very welcome if anyone wants to hack on it.