Optiq Code — Deterministic Code Context Engine for AI Agents
Optiq Code is a deterministic context retrieval engine for software repositories. It parses source code into abstract syntax trees (ASTs), builds dependency graphs, and creates hybrid search indexes combining semantic vector search with keyword matching. When an AI coding agent needs to find relevant code, Optiq returns ranked results with function signatures, call graphs, and confidence scores — in approximately 1-2 seconds.
Key Features
- Hybrid Search: Semantic vector search + keyword matching (Tantivy) in a single query
- AST Parsing: Full abstract syntax tree analysis for 12 languages — Python, TypeScript, JavaScript, TSX, Rust, Go, Java, C, C++, Ruby, PHP, C#
- Symbol Resolution: Tracks imports, exports, function calls, and references across files
- Confidence Scoring: Every result includes a relevance score (0-1) so agents can filter by quality
- MCP Server: Built-in Model Context Protocol server for direct AI agent integration
- CLI Tool:
npm install -g @optiqcode/cli— index, search, and serve from the terminal - Security: AES-256-GCM encryption at rest, per-user database isolation, 99.9% SLA
When to Use Optiq
Use Optiq when your AI coding agent needs to find the right function in a large codebase without scanning every file, understand how code connects across modules, get precise context windows instead of dumping entire files into the prompt, or reduce hallucination by providing verified, ranked code context.
How It Works
- Index: Point Optiq at your repository. It parses every file into an AST, extracts symbols, and builds a dependency graph.
- Search: Query with natural language or structured filters. Optiq combines semantic and keyword search to find the most relevant code.
- Retrieve: Get ranked results with function signatures, confidence scores, and cross-file context — ready for your AI agent's prompt.
API
Base URL: https://api.optiqcode.com
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/search | Search indexed code with natural language |
| POST | /api/v1/repos | Index a repository |
| GET | /api/v1/repos | List indexed repositories |
| GET | /api/v1/jobs/{job_id} | Check indexing job status |
| GET | /api/v1/health | Health check (no auth required) |
Full API specification: OpenAPI 3.1 spec
Authentication
All API requests require a Bearer token. Get your API key from the dashboard (self-serve, no credit card required). Keys support scoped permissions: search:read, repos:read, repos:write, repos:delete, jobs:read.
OAuth Discovery
Authorization server metadata: /.well-known/oauth-authorization-server. Supports PKCE with S256 code challenge method.
Rate Limits
Every API response includes rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After (on 429 responses).
| Plan | Search | Index | Window |
|---|---|---|---|
| Free | 100/day | 10/day | 24h rolling |
| Pro | Unlimited | Unlimited | 1min sliding |
| Enterprise | Custom | Custom | Custom |
Streaming
Add Accept: text/event-stream for Server-Sent Events (SSE) during indexing and search. Events include progress updates and streamed results with confidence scores.
Error Handling
All errors return structured JSON: {"error": {"code": "...", "message": "...", "hint": "..."}}. HTTP status codes: 400 (bad request), 401 (unauthorized), 403 (forbidden scope), 404 (not found), 429 (rate limited), 500 (server error).
MCP Server Integration
Optiq exposes an MCP server for direct AI agent integration.
Discovery
- MCP manifest: /.well-known/mcp
- Server card: /.well-known/mcp/server-card.json
- Remote endpoint:
https://api.optiqcode.com/mcp(Streamable HTTP) - Local:
optiq mcp(stdio transport)
MCP Tools
| Tool | Description | Read-only |
|---|---|---|
| optiq_search | Search indexed code with natural language queries | Yes |
| optiq_index | Index a directory for code search | No |
| optiq_repos | List indexed repositories and status | Yes |
| optiq_status | Check indexing job progress | Yes |
Pricing
| Plan | Price | Repos | Lines | Queries |
|---|---|---|---|---|
| Free | $0/month | 3 | 50,000 | 100/day |
| Pro (Free during beta) | $0/month | Unlimited | Unlimited | Unlimited |
| Enterprise | Custom | Unlimited | Unlimited | Custom |
Machine-readable pricing: /pricing.md
Installation
npm install -g @optiqcode/cli
optiq login
optiq index .
optiq search "your query"
Supported Languages
Python, TypeScript, JavaScript, TSX, Rust, Go, Java, C, C++, Ruby, PHP, C#
Integrations
Works with Cursor, Windsurf, VS Code, JetBrains, Neovim, Claude Desktop, Claude Code, and any MCP-compatible client.
Compare
See how Optiq compares to grep, GitHub Code Search, Sourcegraph, and embedding-only RAG.