A semantic code search tool for intelligent, cross-repo context retrieval.
# h-codex
A semantic code search tool for intelligent, cross-repo context retrieval.
## ✨ Features
- **AST-Based Chunking**: Intelligent code parsing using Abstract Syntax Trees for optimal chunk boundaries
- **Embedding & Semantic Search**: Using OpenAI's `text-embedding-3-small` model (support for `voyage-code-3` planned)
- **Vector Database**: PostgreSQL with pgvector extension for efficient similarity search
- **Multi-Language Support**: TypeScript, JavaScript, and extensible for other languages
- **Multi-Project Support**: Index and search multiple projects
- **MCP Integration**: Seamlessly connects with AI coding assistants through Model Context Protocol
## 🚀 Demo

## 💻 Getting Started
h-codex can be integrated with AI assistants through the Model Context Protocol.
### Example with Claude Desktop
Edit your `claude_mcp_settings.json` file:
```json
{
"mcpServers": {
"h-codex": {
"command": "npx",
"args": ["@hpbyte/h-codex-mcp"],
"env": {
"LLM_API_KEY": "your_llm_api_key_here",
"LLM_BASE_URL": "your_llm_base_url_here (default is openai baseurl: https://api.openai.com/v1)",
"DB_CONNECTION_STRING": "postgresql://postgres:password@localhost:5432/h-codex"
}
}
}
}
```
## 🛠️ Development
### Prerequisites
- [Node.js](https://nodejs.org/) (v18+)
- [pnpm](https://pnpm.io/) - Package manager
- [Docker](https://www.docker.com/) - For running PostgreSQL with pgvector
- OpenAI API key for embeddings
### Getting Started
1. **Clone the repository**
```bash
git clone https://github.com/hpbyte/h-codex.git
cd h-codex
```
2. **Set up environment variables**
```bash
cp packages/core/.env.example packages/core/.env
```
Edit the `.env` file with your OpenAI API key and other configuration options.
3. **Install dependencies**
```bash
pnpm install
```
4. **Start PostgreSQL database**
```bash
cd dev && docker compose up -d
```
5. **Agent that generates comprehensive documentation, API references, architecture diagrams, and developer onboarding guides from existing code.
Agent configuration for systematic bug investigation that traces issues from error logs through the codebase to root cause with suggested fixes.
Agent for integrating third-party APIs including SDK setup, type generation, error handling, retry logic, and rate limit management.
Cursor's built-in autonomous coding agent that can make multi-file edits, run terminal commands, search the codebase, and iteratively build features with minimal human intervention.
Cloud-based autonomous coding agent that runs in the background on remote sandboxed environments, handling complex multi-step tasks while you continue working.
Cursor's multi-file editing agent within Composer mode that can create, edit, and delete files across your entire project in a single conversation.