The AI Layer for your codebase.
Give your coding agent context. Not another agent.
Nix is a local-first AI infrastructure layer for software and intelligent agents.
It gives AI coding agents deep, structured, searchable understanding of your codebase — including files, symbols, dependencies, architecture, Git history, project memory, and related context — while keeping your source code on your machine.
NixAI is the npm package name. nix is the installed CLI command.
Modern AI coding agents are powerful, but their understanding of a codebase is often limited to the files and context currently available to them.
Nix builds a persistent context layer around your project.
Your Codebase
│
▼
┌─────────────────────┐
│ Nix │
│ │
│ Indexing │
│ Code Intelligence │
│ Semantic Search │
│ Git Intelligence │
│ Project Memory │
│ Architecture │
│ Verification │
└──────────┬──────────┘
│
▼
MCP Interface
│
▼
AI Coding Agents
Nix is designed around a simple idea:
Don't make the developer explain the codebase.
Don't make the agent rediscover the codebase.
| Category | Capabilities |
|---|---|
| Search | Hybrid lexical + semantic search, BM25, embeddings, symbol search |
| Code Intelligence | Tree-sitter parsing, symbols, call graphs, dependency graphs |
| Context | Related files, architecture graphs, comprehensive context packages |
| Git | History, blame, changes, hotspots, affected files |
| Memory | Persistent project memories and agent handoffs |
| Security | Secret scanning, malicious-code detection, index recovery |
| Verification | Sandboxed test/build execution and repair workflows |
| MCP | 12 tools for AI agents through stdio transport |
| Embeddings | Local Transformers.js, Ollama, LM Studio, OpenAI-compatible and custom HTTP providers |
TypeScript · JavaScript · Python · Go · Rust · Java · C · C++ · C# · PHP · Ruby
npm install -g nixaiVerify the installation:
nix --version
nix --helpNote:
nixaiis the npm package name andnixis the CLI command.
Install Nix:
npm install -g nixaiConfigure your AI coding agents:
nix setupInitialize Nix inside your project:
cd your-project
nix init
nix indexThat's it.
Your AI coding agent can now access your project's context through MCP.
nix setup can:
- Detect your operating system
- Verify the Nix installation
- Detect supported AI coding agents
- Offer to configure them automatically
- Report what was configured
Supported agents include:
- OpenCode
- Claude Code
- Cursor
- Cline
- Continue
- Windsurf
| Command | Description |
|---|---|
nix setup |
Configure Nix MCP for supported coding agents |
nix setup --remove |
Remove Nix MCP configuration |
nix setup --agents opencode,cursor |
Configure specific agents |
nix setup --yes |
Non-interactive setup |
nix doctor |
Run system diagnostics |
nix doctor --json |
Output machine-readable diagnostics |
| Command | Description |
|---|---|
nix init |
Initialize a Nix project |
nix index |
Incrementally index the project |
nix reindex |
Perform a full reindex |
nix status |
Show project status |
nix config |
View or modify configuration |
nix clean |
Clean index and cache |
| Command | Description |
|---|---|
nix search <query> |
Search the codebase |
nix symbol <name> |
Find a symbol |
nix graph |
Show the architecture graph |
nix tree |
Show the project structure |
nix context <query> |
Generate a comprehensive context package |
| Command | Description |
|---|---|
nix git status |
Show Git status |
nix git history |
Show commit history |
nix git changes |
Show recent changes |
nix git blame <file> |
Show Git blame |
nix git log <file> |
Show file history |
| Command | Description |
|---|---|
nix hardening scan |
Scan for secrets and malicious code |
nix hardening benchmark |
Run retrieval benchmarks |
nix hardening recover |
Recover a corrupted index |
nix verify affected |
Find files affected by Git changes |
nix verify test |
Run tests in a sandbox |
nix verify build |
Run builds in a sandbox |
nix verify repair |
Generate repair suggestions |
| Command | Description |
|---|---|
nix mcp |
Start the MCP server |
nix memory add |
Add project memory |
nix memory list |
List memories |
nix memory search |
Search memories |
nix handoff |
Create or receive agent handoffs |
| Command | Description |
|---|---|
nix explain |
Explain selected code |
nix docs |
Manage documentation |
nix watch |
Watch for project changes |
Nix exposes project intelligence through the Model Context Protocol (MCP).
After running:
nix setupyour supported AI coding agent can access Nix automatically.
| Tool | Description |
|---|---|
search_code |
Lexical + semantic code search |
search_symbols |
Search symbols by name or kind |
get_file |
Read file contents |
get_symbol |
Get symbol details |
find_references |
Find symbol references |
find_callers |
Find function callers |
find_dependencies |
Find dependencies |
get_related_context |
Generate comprehensive context |
get_project_memory |
Retrieve project memories |
get_architecture |
Get the architecture graph |
get_git_context |
Retrieve Git history and changes |
get_project_structure |
Get the project directory tree |
Nix stores project configuration in:
.nix/config.json
Example:
{
"version": 1,
"project": {
"name": "my-project",
"root": "."
},
"index": {
"ignoredPaths": [],
"maxFileSize": 1048576
},
"search": {
"weights": {
"lexicalWeight": 1,
"semanticWeight": 1,
"symbolWeight": 1,
"pathWeight": 1,
"graphWeight": 1,
"recencyWeight": 1
}
},
"embeddings": {
"provider": "local",
"model": "Xenova/all-MiniLM-L6-v2",
"apiBase": "",
"apiKey": "",
"dimensions": 384,
"batchSize": 32
},
"mcp": {
"enabled": true
},
"hardening": {
"enableSecretScanning": true,
"enableMaliciousDetection": true,
"enableCorruptedIndexRecovery": true,
"maxFileSizeForScanning": 1048576
}
}Nix supports multiple embedding backends:
| Provider | Configuration | Description |
|---|---|---|
local |
Default | Runs locally through Transformers.js |
ollama |
apiBase |
Local Ollama server |
lmstudio |
apiBase |
Local LM Studio server |
openai |
apiKey, apiBase |
OpenAI-compatible API |
custom |
Custom configuration | HTTP embedding endpoint |
The default local provider does not require an API key.
┌──────────────────────────────────────────────────────────┐
│ Nix Core │
├──────────────────────────────────────────────────────────┤
│ Indexer │ Search │ Storage │ Memory │ Git │ Verification │
└──────┬────────┬──────────┬─────────┬─────┬───────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌───────┐ ┌────────┐ ┌────────┐ ┌────────┐
│ CLI │ │ SQLite │ │ MCP │ │ Memory │
└───────┘ └────────┘ └────────┘ └────────┘
Nix is designed to keep project intelligence local.
- No telemetry by default
- No cloud service required
- No source-code upload
- Completely offline capable
- Project indexes and context remain on your machine
External embedding providers can be configured when explicitly desired.
Clone the repository and install dependencies:
pnpm installBuild:
pnpm buildRun linting:
pnpm lintRun tests:
pnpm testTypecheck:
pnpm typecheckFormat:
pnpm format- Node.js
>= 20.0.0 - pnpm
>= 9.0.0for development
Remove the global npm package:
npm uninstall -g nixaiRemove Nix project data:
rm -rf .nixRemove Nix MCP configuration:
nix setup --removeIf you discover a security vulnerability, please follow the security policy in:
SECURITY.md
Do not publicly disclose sensitive vulnerabilities before they have been responsibly reported.
Contributions, bug reports, ideas, and improvements are welcome.
See:
CONTRIBUTING.md
MIT — see LICENSE.
nix
Context intelligence for AI coding agents.