Metadata-Version: 2.5
Name: hexify-ai
Version: 0.1.1
Summary: Config-driven Python SDK for building AI agents and RAG pipelines.
Project-URL: Homepage, https://github.com/asad926/hexify-sdk
Project-URL: Repository, https://github.com/asad926/hexify-sdk
Project-URL: Issues, https://github.com/asad926/hexify-sdk/issues
Project-URL: Changelog, https://github.com/asad926/hexify-sdk/blob/main/CHANGELOG.md
Author: Hexify SDK Contributors
License: MIT
License-File: LICENSE
Keywords: agents,ai,claude,llm,rag
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: anthropic<1,>=0.40
Requires-Dist: httpx<1,>=0.27
Requires-Dist: openai<2,>=1.0
Requires-Dist: pgvector<1,>=0.3
Requires-Dist: psycopg[binary]<4,>=3.1
Requires-Dist: pydantic<3,>=2.6
Provides-Extra: dev
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# Hexify SDK

Config-driven Python SDK for building AI agents and RAG pipelines.

**Import name:** `hexify` · **Pip name:** `hexify-ai` · **Python:** 3.10+

v1 is a library, not a hosted API: config in, working agent out, in one Python call.

```python
from hexify import Agent

agent = Agent(
    name="assistant",
    llm="claude-sonnet-5",
    system_prompt="You are a helpful assistant.",
)
print(agent.run("Hello!"))
```

## Install

```bash
pip install hexify-ai
```

From this repo: `pip install -e ".[dev]"`.

## Quickstart (under 5 minutes)

1. Python 3.10+ and an [Anthropic API key](https://console.anthropic.com/).
2. Set `ANTHROPIC_API_KEY` (`export ANTHROPIC_API_KEY=sk-ant-...` or, in PowerShell, `$env:ANTHROPIC_API_KEY="sk-ant-..."`).
3. `pip install hexify-ai`
4. Run the snippet above, or:

```bash
python examples/basic_agent.py
```

Subsequent `agent.run(...)` calls on the same instance keep in-process conversation memory.

## RAG + tools

```python
from hexify import Agent, RAG

rag = RAG(
    source="./docs",
    embedder="openai",
    vectorstore="pgvector",
    pg_connection_string="postgresql://user:pass@localhost/hexify",
)
agent = Agent(
    name="support-bot",
    llm="claude-sonnet-5",
    rag=rag,
    tools=["web_search"],
    system_prompt="You are a support agent for Acme App.",
)
print(agent.run("How do I reset my password?"))
```

v1 models: `claude-sonnet-5` (default), `claude-haiku-4-5`.  
v1 vectorstore: `pgvector` only.  
v1 built-in tools: `web_search` and `send_email` (deterministic stubs — no live web or SMTP).

RAG also needs `OPENAI_API_KEY` (embeddings) and a Postgres database with the `vector` extension.

## CLI

```bash
hexify init
hexify run hexify.json --message "Hello"
hexify run hexify.json          # interactive prompt (quit / Ctrl-D to exit)
```

`hexify.json` is an [`AgentConfig`](docs/README.md#config-schema) file. Folder `rag_source` values are resolved relative to that file. Set `HEXIFY_PG_CONNECTION_STRING` when RAG is enabled.

## Environment

| Variable | Used by |
|---|---|
| `ANTHROPIC_API_KEY` | Claude (`Agent.run`) |
| `OPENAI_API_KEY` | OpenAI embeddings (`RAG`) |
| `HEXIFY_PG_CONNECTION_STRING` | pgvector (`RAG`, `hexify run`) |

## Custom tools

```python
from hexify.tools import tool

@tool(
    name="order_status",
    description="Look up an order by id.",
    input_schema={
        "type": "object",
        "properties": {"order_id": {"type": "string"}},
        "required": ["order_id"],
    },
)
def order_status(args: dict) -> str:
    return f"Order {args['order_id']} shipped."
```

Then pass `tools=["order_status"]` (and any built-ins) into `Agent`.

## Logging

Each `Agent.run` emits one JSON line on the `hexify.run` logger: tokens, latency (ms), tool names, RAG hit count, and `ok`. `hexify run` prints these on stderr.

## Examples

- [`examples/basic_agent.py`](examples/basic_agent.py) — smallest working agent
- [`examples/rag_support_bot.py`](examples/rag_support_bot.py) — RAG + `web_search`
- [`examples/hexify.json`](examples/hexify.json) — CLI config

## Docs

- [User guide](docs/README.md) — config schema, CLI, tools, memory, limits
- [v1 build spec](docs/hexify-sdk-v1-spec.md) — scope and public API contract

## Develop

For the full contributor guide (branching, testing, releasing), see
[**DEVELOPING.md**](DEVELOPING.md). The short version:

```bash
git clone https://github.com/asad926/hexify-sdk
cd hexify-sdk
python -m venv .venv
. .venv/Scripts/Activate.ps1   # Windows PowerShell
pip install -e ".[dev]"
pre-commit install             # optional but recommended
ruff check .
pytest --cov=hexify
```

`cp .env.example .env` to start a local secrets file (git-ignored).

## License

MIT — see [LICENSE](LICENSE).
