Skip to content

Commit d8c3670

Browse files
author
jnorthrup
committed
feat: Python 3.14 compatibility, REPL mode, NVIDIA provider, memory systems
Features: - Python 3.14 compatibility (forward-compatible pydantic, puremagic) - Interactive REPL mode with tab completion - NVIDIA provider with qwen3-coder-480b default - Three memory backends: hashtable, memvid QR, DuckDB - Split install: full (2GB) vs lite (200MB) Implementation: - src/ii_agent/cli/: REPL entry point - src/ii_agent/db/: Async SQLite, DuckDB - src/ii_agent/storage/: Memory backends - requirements-lite.txt: Minimal install 35 files changed, 3904 insertions(+), 1644 deletions(-)
1 parent ea807ea commit d8c3670

34 files changed

+3929
-1644
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
## collector branch (2025-11-19)
4+
5+
### Features
6+
- **Python 3.14 compatibility**: Forward-compatible pydantic, puremagic instead of imghdr
7+
- **REPL mode**: Interactive CLI with tab completion for model/provider selection
8+
- **NVIDIA provider**: Qwen3-coder-480b default, Bayesian model ranking
9+
- **Memory systems**: Hashtable, memvid QR, DuckDB vector search
10+
- **Installation options**: Full (2GB) or lite (200MB via requirements-lite.txt)
11+
12+
### Implementation
13+
- `src/ii_agent/cli/`: REPL mode entry point and implementation
14+
- `src/ii_agent/db/`: Async SQLite, DuckDB integration
15+
- `src/ii_agent/storage/`: Three memory backend options
16+
- `src/ii_agent/server/api/nvidia_models.py`: NVIDIA model fetching
17+
- `scripts/fetch_nvidia_models.py`: Bayesian ranking script
18+
19+
### Breaking Changes
20+
- Unpinned pydantic (was ==2.11.7, now >=2.11.7)
21+
- Removed deprecated test files
22+
23+
### Documentation
24+
- `docs/INSTALL.md`: Installation guide
25+
- `requirements-lite.txt`: Minimal REPL-only install

docs/INSTALL.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Installation Guide
2+
3+
## Installation Modes
4+
5+
### Full Installation (Default)
6+
7+
```bash
8+
pip install -e .
9+
```
10+
11+
**Includes everything:**
12+
- Core LLM providers: Anthropic, OpenAI, LiteLLM, NVIDIA
13+
- REPL mode + Server mode
14+
- File processing tools
15+
- MCP support
16+
- Search/Web tools
17+
- **GCP:** Vertex AI, Cloud Storage, Google APIs
18+
- **Server mode:** FastAPI, WebSocket, Redis, Postgres, SQLite
19+
- **Sandboxing:** E2B, Playwright
20+
- **Auth:** OAuth, JWT, Stripe
21+
- **Extras:** APScheduler, transformers, pytest
22+
23+
**Size:** ~2GB | **Install time:** 3-5 minutes (GCP dependency resolution)
24+
25+
### Lite Installation (REPL only, no GCP)
26+
27+
```bash
28+
pip install -r requirements-lite.txt
29+
pip install -e . --no-deps
30+
```
31+
32+
**Includes:**
33+
- Core LLM providers: Anthropic, OpenAI, LiteLLM
34+
- REPL mode only
35+
- File processing tools
36+
- MCP support
37+
- Search/Web tools
38+
- **No GCP, no server, no databases**
39+
40+
**Size:** ~200MB | **Install time:** 30 seconds
41+
42+
## Quick Start
43+
44+
### REPL Mode (Lite)
45+
```bash
46+
# Install lite
47+
pip install -r requirements-lite.txt
48+
pip install -e . --no-deps
49+
50+
# Set API key
51+
export NVIDIA_API_KEY=nvapi-...
52+
53+
# Run REPL
54+
ii-agent --repl
55+
```
56+
57+
### REPL Mode (Full)
58+
```bash
59+
# Install full
60+
pip install -e .
61+
62+
# Set API key
63+
export NVIDIA_API_KEY=nvapi-...
64+
65+
# Run REPL
66+
ii-agent --repl
67+
```
68+
69+
### Server Mode
70+
```bash
71+
# Install full
72+
pip install -e .
73+
74+
# Set up database
75+
# Configure .env
76+
77+
# Run server
78+
ii-agent
79+
# OR
80+
ii-agent --port 8080
81+
```
82+
83+
## Python 3.14 Compatibility
84+
85+
If using Python 3.14, set this environment variable before installing:
86+
87+
```bash
88+
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
89+
pip install -e .
90+
```
91+
92+
## Dependencies
93+
94+
### Lite Install (requirements-lite.txt)
95+
```
96+
Core: anthropic, litellm, openai, pydantic
97+
MCP/Tools: fastmcp, libtmux
98+
REPL: prompt-toolkit, rich
99+
File: pandas, pymupdf, python-pptx, weasyprint, mammoth
100+
Search: ddgs, duckduckgo-search, tavily-python
101+
Utils: python-dotenv, tenacity, ast-grep-cli
102+
```
103+
**Total:** ~45 packages, ~200MB
104+
105+
### Full Install (pip install -e .) - Adds:
106+
```
107+
Server: alembic, aiosqlite, asyncpg, psycopg2-binary, redis
108+
fastapi, fastapi-sso, python-socketio, starlette, uvicorn
109+
110+
GCP: anthropic[vertex], gcloud-aio-storage
111+
google-api-python-client, google-auth-oauthlib
112+
google-cloud-aiplatform, google-genai
113+
114+
Sandboxing: e2b-code-interpreter, playwright
115+
116+
Auth: bcrypt, cryptography, email-validator, PyJWT, stripe
117+
118+
Extras: apscheduler, ii-researcher, pydub, pytest
119+
python-crontab, speechrecognition, transformers
120+
```
121+
**Total:** ~95 packages, ~2GB
122+
123+
## Known Issues
124+
125+
**GCP packages may cause slow dependency resolution:**
126+
- `google-api-python-client` + `google-cloud-aiplatform` + `anthropic[vertex]` have complex dependency trees
127+
- Pip resolver may take 3-5 minutes
128+
- Total install size: ~2GB with all dependencies
129+
130+
## Troubleshooting
131+
132+
### Dependency resolver hangs
133+
```bash
134+
# Be patient - GCP packages take 3-5 minutes to resolve
135+
# Or use --no-deps if you know dependencies are satisfied
136+
pip install -e .
137+
```
138+
139+
### Python 3.14 build errors
140+
```bash
141+
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
142+
pip install -e .
143+
```
144+
145+
## Development
146+
147+
```bash
148+
# Full install (default)
149+
pip install -e .
150+
151+
# GAIA benchmark tasks (adds datasets, huggingface-hub)
152+
pip install -e .[gaia]
153+
```

docs/docs/required-environment-variables/core-infra.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ slug: /required-environment-variables/core-infra
55
sidebar_position: 18
66
---
77

8-
These variables cover databases, caches, and host port mappings used by the Docker stack. Most of them can stay at their defaults unless you have port conflicts or custom credentials.
8+
These variables cover databases, caches, and host port mappings. For local development without Docker, SQLite is used by default with no configuration required. For Docker deployments, configure PostgreSQL as described below.
99

10-
## Postgres (`POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `POSTGRES_PORT`)
10+
## Postgres (Docker Only) (`POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `POSTGRES_PORT`)
1111

1212
1. Pick credentials you are comfortable using for local development. Example:
1313
```bash
@@ -21,8 +21,15 @@ These variables cover databases, caches, and host port mappings used by the Dock
2121

2222
## `DATABASE_URL`
2323

24-
- Async connection string used by the backend (e.g., `postgresql+asyncpg://app:changeme@postgres:5432/ii`).
25-
- Ensure the host matches the service name inside Docker (`postgres` by default) instead of `localhost`.
24+
**Default (Local Development):** SQLite at `~/.ii_agent/ii_agent.sqlite` - no setup required.
25+
26+
**Docker/Production (PostgreSQL):**
27+
- Async connection string: `postgresql+asyncpg://app:changeme@postgres:5432/ii`
28+
- Ensure the host matches the service name inside Docker (`postgres` by default) instead of `localhost`
29+
30+
**Other Options:**
31+
- DuckDB: `duckdb:///~/.ii_agent/ii_agent.duckdb`
32+
- In-memory SQLite (testing): `sqlite+aiosqlite:///:memory:`
2633

2734
## Sandbox database (`SANDBOX_DB_NAME`, `SANDBOX_DATABASE_URL`)
2835

pyproject.toml

Lines changed: 65 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,92 @@ readme = "README.md"
66
authors = [{ name = "Intelligent Internet", email = "[email protected]" }]
77
requires-python = ">=3.10"
88
dependencies = [
9+
# Core agent
10+
"anthropic>=0.72.0",
11+
"litellm>=1.63.14",
12+
"openai>=1.68.2",
13+
"pydantic>=2.11.7",
14+
15+
# MCP/Tools
16+
"fastmcp==2.10.6",
17+
"libtmux==0.46.2",
18+
19+
# REPL
20+
"prompt-toolkit>=3.0.51",
21+
"rich==14.1.0",
22+
23+
# File processing
924
"dataclasses-json>=0.6.7",
10-
"duckduckgo-search>=8.0.1",
11-
"fastapi>=0.115.12",
12-
"google-cloud-aiplatform>=1.90.0",
13-
"google-genai>=1.14.0",
14-
"ii-researcher>=0.1.5",
1525
"jsonschema>=4.23.0",
26+
"langchain-text-splitters>=1.0.0",
1627
"mammoth>=1.9.0",
1728
"markdownify>=1.1.0",
1829
"pandas>=2.2.3",
1930
"pathvalidate>=3.2.3",
2031
"pdfminer-six>=20250506",
21-
"openai>=1.68.2",
22-
"pexpect>=4.9.0",
2332
"pillow>=11.2.1",
24-
"pip>=25.1.1",
25-
"playwright==1.55.0",
26-
"prompt-toolkit>=3.0.51",
2733
"puremagic>=1.29",
28-
"pydub>=0.25.1",
2934
"pymupdf>=1.25.5",
30-
"pytest>=8.3.5",
31-
"python-dotenv>=1.1.0",
35+
"pypdf>=6.1.1",
36+
"python-magic>=0.4.27",
3237
"python-pptx>=1.0.2",
33-
"rich==14.1.0",
34-
"speechrecognition>=3.14.2",
38+
"weasyprint>=66.0",
39+
40+
# Search/Web
41+
"ddgs>=9.9.1",
42+
"duckduckgo-search>=8.0.1",
3543
"tavily-python>=0.7.2",
44+
"youtube-transcript-api>=1.0.3",
45+
46+
# Utils
47+
"pexpect>=4.9.0",
48+
"pip>=25.1.1",
49+
"python-dotenv>=1.1.0",
3650
"tenacity>=9.1.2",
3751
"termcolor>=3.0.1",
38-
"uvicorn[standard]>=0.29.0,<0.30.0",
39-
"youtube-transcript-api>=1.0.3",
52+
53+
# AST/Code tools
54+
"ast-grep-cli>=0.39.5",
55+
56+
# Server mode
4057
"alembic>=1.16.1",
41-
"fastmcp==2.10.6",
42-
"libtmux==0.46.2",
43-
"bcrypt>=4.0.0",
44-
"PyJWT>=2.8.0",
45-
"email-validator>=2.0.0",
46-
"cryptography>=42.0.0",
47-
"fastapi-sso>=0.16.0",
4858
"aiosqlite>=0.21.0",
49-
"pydantic==2.11.7",
50-
"e2b-code-interpreter==1.2.0b5",
51-
"python-socketio>=5.13.0",
52-
"gcloud-aio-storage==9.5.0",
53-
"transformers>=4.44.0",
54-
"weasyprint>=66.0",
55-
"python-magic>=0.4.27",
5659
"asyncpg>=0.30.0",
57-
"stripe>=11.1.0",
58-
"python-crontab>=2.7.1",
5960
"psycopg2-binary>=2.9.10",
60-
"ast-grep-cli>=0.39.5",
61-
"starlette[full]>=0.46.2",
6261
"redis>=5.0.0",
63-
"pypdf>=6.1.1",
64-
"apscheduler>=3.11.0",
65-
"litellm>=1.63.14",
62+
"fastapi>=0.115.12",
63+
"fastapi-sso>=0.16.0",
64+
"python-socketio>=5.13.0",
65+
"starlette[full]>=0.46.2",
66+
"uvicorn[standard]>=0.29.0,<0.30.0",
67+
68+
# Auth/Security
69+
"bcrypt>=4.0.0",
70+
"cryptography>=42.0.0",
71+
"email-validator>=2.0.0",
72+
"PyJWT>=2.8.0",
73+
"stripe>=11.1.0",
74+
75+
# GCP
6676
"anthropic[vertex]>=0.72.0",
67-
"langchain-text-splitters>=1.0.0",
68-
"google-auth-oauthlib>=1.2.3",
77+
"gcloud-aio-storage==9.5.0",
6978
"google-api-python-client>=2.150.0",
70-
"ddgs>=9.9.1",
79+
"google-auth-oauthlib>=1.2.3",
80+
"google-cloud-aiplatform>=1.90.0",
81+
"google-genai>=1.14.0",
82+
83+
# Sandboxing
84+
"e2b-code-interpreter==1.2.0b5",
85+
"playwright==1.55.0",
86+
87+
# Extra tools
88+
"apscheduler>=3.11.0",
89+
"ii-researcher>=0.1.5",
90+
"pydub>=0.25.1",
91+
"pytest>=8.3.5",
92+
"python-crontab>=2.7.1",
93+
"speechrecognition>=3.14.2",
94+
"transformers>=4.44.0",
7195
]
7296

7397
[project.optional-dependencies]

requirements-lite.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ii-agent Lite - REPL only, no GCP/server/sandboxing
2+
# Install: pip install -r requirements-lite.txt
3+
4+
# Core agent
5+
anthropic>=0.72.0
6+
litellm>=1.63.14
7+
openai>=1.68.2
8+
pydantic>=2.11.7
9+
10+
# MCP/Tools
11+
fastmcp==2.10.6
12+
libtmux==0.46.2
13+
14+
# REPL
15+
prompt-toolkit>=3.0.51
16+
rich==14.1.0
17+
18+
# File processing
19+
dataclasses-json>=0.6.7
20+
jsonschema>=4.23.0
21+
langchain-text-splitters>=1.0.0
22+
mammoth>=1.9.0
23+
markdownify>=1.1.0
24+
pandas>=2.2.3
25+
pathvalidate>=3.2.3
26+
pdfminer-six>=20250506
27+
pillow>=11.2.1
28+
puremagic>=1.29
29+
pymupdf>=1.25.5
30+
pypdf>=6.1.1
31+
python-magic>=0.4.27
32+
python-pptx>=1.0.2
33+
weasyprint>=66.0
34+
35+
# Search/Web
36+
ddgs>=9.9.1
37+
duckduckgo-search>=8.0.1
38+
tavily-python>=0.7.2
39+
youtube-transcript-api>=1.0.3
40+
41+
# Utils
42+
pexpect>=4.9.0
43+
pip>=25.1.1
44+
python-dotenv>=1.1.0
45+
tenacity>=9.1.2
46+
termcolor>=3.0.1
47+
48+
# AST/Code tools
49+
ast-grep-cli>=0.39.5

0 commit comments

Comments
 (0)