Metadata-Version: 2.4
Name: ai-cortex
Version: 0.1.0
Summary: An agentic CLI coding assistant powered by local LLMs via Ollama
Project-URL: Homepage, https://github.com/hasanjawad001/ai-cortex
Project-URL: Repository, https://github.com/hasanjawad001/ai-cortex
Author-email: hasanjawad001 <hasanjawad001@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai,cli,coding-assistant,llm,ollama
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.12
Requires-Dist: ollama
Requires-Dist: pydantic
Requires-Dist: pyyaml
Requires-Dist: rich
Description-Content-Type: text/markdown

# AI-Cortex

An agentic CLI coding assistant powered entirely by local LLMs via Ollama.

AI-Cortex gives you an agentic coding assistant that runs 100% locally — no API keys, no cloud, full privacy. It uses a local LLM (default: qwen3.5:9b) and an agentic loop that decides which tools to call, executes them, and feeds results back to the model until the task is done.

## Features

- **Agentic loop** — model autonomously decides which tools to call and chains them together
- **6 built-in tools** — `read_file`, `write_file`, `run_bash`, `list_dir`, `search_files`, `fetch_url`
- **Streaming output** — responses appear token by token
- **Permission prompts** — asks before running bash commands or writing files
- **Loop detection** — catches the model repeating the same action
- **Error handling** — retries on failures, catches malformed tool calls
- **Configurable** — model, host via `~/.ai-cortex/config.yaml` or CLI flags

## Prerequisites

- [Ollama](https://ollama.com/) installed and running
- A local model pulled (e.g. `ollama pull qwen3.5:9b`)

## Install

```bash
pip install ai-cortex
```

Or install from source:

```bash
git clone https://github.com/hasanjawad001/ai-cortex.git
cd ai-cortex
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e .
```

## Usage

```bash
# Start ai-cortex
ai-cortex

# Skip permission prompts
ai-cortex --yolo

# Use a different model
ai-cortex --model=llama3:8b
```

### Example

```
you> read pyproject.toml and tell me the project name
  → read_file({"path": "pyproject.toml"})
  [project]
  name = "ai-cortex"
  ...
ai-cortex> The project name is "ai-cortex", version 0.1.0.
```

## Configuration

AI-Cortex creates `~/.ai-cortex/config.yaml` on first run:

```yaml
model: qwen3.5:9b
host: http://localhost:11434
```

## How It Works

1. You type a request
2. The LLM decides which tool(s) to call
3. AI-Cortex executes the tool and feeds the result back
4. The LLM either calls another tool or responds with a summary
5. Repeat until done (max 15 turns)

## License

MIT
