Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
12dc742
feat: update 10xgraph and 10xgraph-api versions to 1.0.0rc1 in uv.lock
Iamsdt Oct 28, 2026
7b4cdf9
feat: change rate limit backend to memory and clean up configuration
Iamsdt Oct 28, 2026
3160bdb
feat: run trace, thread paging, file list, live options; remove eval …
Iamsdt Oct 28, 2026
07dba21
feat: enhance production setup with recommended configurations
Iamsdt Oct 29, 2026
5621f03
Add unit tests for resume handling, run entry guards, and shutdown re…
Iamsdt Oct 29, 2026
105b544
Add unit tests for media ownership, production template validators, r…
Iamsdt Oct 29, 2026
3a3c51e
fix: improve exception handling and comments in init, test, and serve…
Iamsdt Oct 29, 2026
ba7311f
feat: remove IS_DEBUG configuration and update related documentation …
Iamsdt Oct 29, 2026
a24aa39
feat: remove IS_DEBUG configuration from production environment template
Iamsdt Oct 29, 2026
fd31a51
feat(eval): enhance evaluation command with HTML report generation an…
Iamsdt Oct 29, 2026
a9bb26b
feat(eval): record pass-rate gate in evaluation reports metadata
Iamsdt Oct 29, 2026
38f0349
feat(shutdown): ensure thread lock is released only after run save du…
Iamsdt Oct 30, 2026
9c6b337
feat: update version to 1.0.0rc2 and enhance weather tool functionality
Iamsdt Oct 30, 2026
35b5349
feat(dependencies): add gunicorn and uvicorn-worker for production wo…
Iamsdt Oct 30, 2026
f51eae9
Refactor code structure for improved readability and maintainability
Iamsdt Oct 30, 2026
79c144e
feat: enhance type hinting and improve code clarity across multiple m…
Iamsdt Oct 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ cython_debug/

# uv lockfile: not tracked (this is a library; CI resolves fresh)
uv.lock

# Media uploads written by local runs and tests
uploads/
16 changes: 16 additions & 0 deletions 10xgraph.json.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"agent": "graph.react:app",
"thread_name_generator": "graph.thread_name_generator:MyNameGenerator",
"store": "graph.dummy_store:store",
"env": ".env",
"auth": null,
"rate_limit": {
"enabled": true,
"backend": "memory",
"requests": 100,
"window": 60,
"by": "ip",
"trusted_proxy_headers": false,
"exclude_paths": ["/health", "/docs", "/redoc", "/openapi.json"]
}
}
352 changes: 349 additions & 3 deletions CHANGELOG.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ core framework see `agentflow/CLAUDE.md`; for the TS client, docs, or playground
for the monorepo overview see the workspace-root `CLAUDE.md`.

- Package name (PyPI): `10xgraph-api` (formerly `10xscale-agentflow-cli`, last release 0.6.x)
- Version: `1.0.0rc1` (`pyproject.toml`; 0.7.0 was the first release under the 10xGraph name). `CLI_VERSION`
- Version: `1.0.0rc2` (`pyproject.toml`; 0.7.0 was the first release under the 10xGraph name). `CLI_VERSION`
and `tenxgraph_api.__version__` are single-sourced from the installed distribution metadata
(falling back to `pyproject.toml` only for a non-installed source checkout).
- Requires: Python >= 3.12 · Status: `5 - Production/Stable`
- Console entry points: `10xgraph = tenxgraph_api.cli.main:main`, plus the deprecated alias
`agentflow = tenxgraph_api.cli.main:legacy_main` (prints a notice to stderr; removed in 2.0)
- Depends on the core framework: `10xgraph>=1.0.0rc1,<2.0` (import `tenxgraph`). Must not be
- Depends on the core framework: `10xgraph>=1.0.0rc2,<2.0` (import `tenxgraph`). Must not be
installed alongside the old `10xscale-agentflow`: both provide an `agentflow` module.

## Rename compatibility (kept until 2.0)
Expand Down Expand Up @@ -54,7 +54,7 @@ Public exports from the package root (`from tenxgraph_api import ...`): `BaseAut
| `10xgraph dev` | The only server command: local Uvicorn dev server (reload on) via `commands/api.py::APICommand`, opens the hosted playground when ready. `api` and `play` were removed (use `dev --no-open` / `dev`); production runs Gunicorn in the `10xgraph build` image | `--config/-c` (default `10xgraph.json`), `--host/-H`, `--port/-p` (8000), `--reload/--no-reload`, `--open/--no-open`, `-v/-q` |
| `10xgraph init` | Interactively scaffold a project (guided prompts pick dev vs production, auth, rate limit) | `--path/-p`, `--force/-f`, `--name`, `--template` (quick-start\|production), `--auth` (none\|jwt\|custom), `--rate-limit` (none\|memory\|redis), `--provider` (google\|openai\|anthropic), `--websocket/--no-websocket` (default off; writes `websocket.enabled`). Prod `pyproject.toml` depends on `10xgraph[<provider>]` and `10xgraph-api[jwt,redis,websocket]` as chosen, `--yes/-y`, `--non-interactive`, `--dry-run`. There is **no `--prod` flag** |
| `10xgraph build` | Generate a `Dockerfile` (and optionally `docker-compose.yml` / `k8s.yaml`). The builder stage strips CLI assets, runs `tenxgraph_api/_slim_image.py` (uninstalls typer/rich/questionary and what only they need, unless another package needs them) and removes pip, so the image carries no CLI code paths | `--output/-o`, `--force/-f`, `--python-version` (3.13), `--port`, `--docker-compose/--no-docker-compose`, `--k8s/--no-k8s`, `--service-name` |
| `10xgraph eval` | Run agent evaluations; discovers `*_eval.py`/`eval_*.py`, runs cases (optionally `--parallel`), writes HTML+JSON to `eval_reports/` | `--output/-o`, `--no-report`, `--threshold/-t`, `--open`, `--parallel/-p`, `--max-concurrency/-c` |
| `10xgraph eval` | Run agent evaluations; discovers `*_eval.py`/`eval_*.py`, runs cases (optionally `--parallel`), writes JSON and HTML reports to `eval_reports/` and opens the HTML report in the browser (only at an interactive terminal: skipped with `--no-open`, `--no-report`, `-q`, json/jsonl, `--non-interactive`, `CI`, non-TTY; `evaluation.open_report` in `10xgraph.json` sets the default). Simulations print per-turn step lines via `ProgressRun.step` | `--output/-o`, `--no-report`, `--threshold/-t`, `--parallel/-p`, `--max-concurrency/-c`, `--open/--no-open` |
| `10xgraph test` | Run project tests via pytest (args after `--` forwarded verbatim) | `--coverage/-C`, `--html`, `-k`, path arg |
| `10xgraph skills` | Install the bundled 10xGraph skill (Agent Skills spec) for Codex/Claude/GitHub, or validate skills | `--agent/-a`, `--path/-p`, `--force/-f`, `--all`, `--list/-l`, `--validate PATH` |
| `10xgraph version` | Show CLI + core framework version | both resolve from installed distribution metadata |
Expand Down Expand Up @@ -194,7 +194,7 @@ and for redis backend a `redis` sub-object `{ "url", "prefix" }` (or shorthand U
`THREAD_BUSY_WAIT_SECONDS` (30), then 409 "thread is busy" in the standard error envelope (WS: error chunk
`data.reason = "thread is busy"`, socket stays open). Request option `on_busy`
(`"wait"` | `"cancel"`, top level next to `recursion_limit`; not on AG-UI): `cancel` calls
`GraphService.stop_graph` while waiting. `/v1/graph/live` is not locked.
`GraphService.stop_graph` while waiting. `/v1/graph/live` takes the lock for the session (and a run slot) too, refused with a fatal `thread_busy` / `too_many_runs` error event and close 1013. Every entry point takes lock + run slot through `routers/graph/run_guard.py::acquire_run_guard`. A Redis error falls back to a per-process count; a refresh that finds its lease gone sets `Lease.lost` and takes it again.
- **Production error chunks:** `graph_service.sanitize_error_chunk` (called in
`stream_chunks`, so stream, WS and AG-UI share it) replaces `data.reason` / `data.error` /
`data.message` and `state.execution_meta.internal_data["error"]` of `ERROR` chunks with the
Expand Down Expand Up @@ -227,13 +227,13 @@ were removed in the 0.5.0 readiness pass; they were fully commented out and neve
`core/config/settings.py` is a `pydantic-settings` `Settings` (with `extra="allow"`, so unknown
env vars are tolerated). Notable vars: `APP_NAME`, `APP_VERSION`, `MODE` (`production` | `prod` |
`development` | `dev` | `local`, case-insensitive, normalised to `production` or `development`;
anything else refuses to start, unset is `development`), `LOG_LEVEL`, `IS_DEBUG`, `MAX_REQUEST_SIZE` (10MB default), security headers
anything else refuses to start, unset is `development`), `LOG_LEVEL`, `MAX_REQUEST_SIZE` (10MB default), security headers
(`SECURITY_HEADERS_ENABLED`, `HSTS_*`, `FRAME_OPTIONS`, `CSP_POLICY`, ...), `ORIGINS` (CORS,
default `*` with a wildcard warning), `ALLOWED_HOST`, `ROOT_PATH`/`DOCS_PATH`/`REDOCS_PATH`,
`REDIS_URL`, `SENTRY_DSN`, `SNOWFLAKE_*` (epoch/node/worker/bit layout), `JWT_SECRET_KEY`/
`JWT_ALGORITHM`, `OTEL_ENABLED`/`OTEL_SERVICE_NAME`/`OTEL_EXPORTER_OTLP_ENDPOINT`/`OTEL_LEVEL`,
`STRICT_PRODUCTION_CHECKS` (production refuses wildcard `ALLOWED_HOST`/`ORIGINS` or enabled
docs). `IS_DEBUG` is forced off in production. Media: `MEDIA_REQUIRE_OWNER` defaults on in
docs). Debug follows `MODE` (on in development, off in production); a leftover `IS_DEBUG` is ignored with a warning. Media: `MEDIA_REQUIRE_OWNER` defaults on in
production. In production: set `MODE=production`, a non-`*` `ORIGINS`, and a strong
`JWT_SECRET_KEY`; see `SECURITY.md` for the full checklist.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
[![Python](https://img.shields.io/pypi/pyversions/10xgraph-api)](https://pypi.org/project/10xgraph-api/)
[![License](https://img.shields.io/github/license/10xGraph/10xgraph-api)](https://github.com/10xGraph/10xgraph-api/blob/main/LICENSE)

`10xgraph-api` generates the production server around a [10xGraph](https://github.com/10xGraph/10xGraph) agent. Point `10xgraph.json` at your compiled graph and it serves REST, SSE streaming, WebSocket and realtime-audio endpoints with JWT or custom auth, scoped authorization on every endpoint, owner-only threads and rate limiting, then writes your Docker Compose and Kubernetes files. MIT licensed and self-hosted.
`10xgraph-api` generates the production server around a [10xGraph](https://github.com/10xGraph/10xGraph) agent. Point `10xgraph.json` at your compiled graph and it serves REST, NDJSON streaming, WebSocket and realtime-audio endpoints with JWT or custom auth, scoped authorization on every endpoint, owner-only threads and rate limiting, then writes your Docker Compose and Kubernetes files. MIT licensed and self-hosted.

Other frameworks give you the graph. 10xGraph gives you the graph and the server around it, in the same open-source project.

---

## What the server gives you

- **Endpoints generated from the graph.** Invoke, SSE stream, stop, WebSocket and realtime audio; threads, state and messages; the memory store; file uploads for multimodal input; and an optional [AG-UI](https://10xgraph.com/docs/server/ag-ui) endpoint for CopilotKit and other AG-UI clients.
- **Endpoints generated from the graph.** Invoke, NDJSON stream, stop, WebSocket and realtime audio; threads, state and messages; the memory store; file uploads for multimodal input; and an optional [AG-UI](https://10xgraph.com/docs/server/ag-ui) endpoint for CopilotKit and other AG-UI clients.
- **Authentication.** `"auth": "jwt"`, or your own `BaseAuth` subclass.
- **Scoped authorization on every endpoint.** Routes require `resource:action` scopes such as `graph:invoke`, `graph:stream` or `checkpointer:read`, checked by a pluggable `AuthorizationBackend`. The server refuses to start if any non-public route has no guard.
- **Owner-only threads.** In production mode a thread is readable and writable only by the user who created it, on every step that touches it. Ownership checks are cached in-process and optionally in Redis, so they do not hit the database on each request.
Expand Down Expand Up @@ -217,7 +217,7 @@ Generate production Docker files.

### `10xgraph eval` / `10xgraph test`

Run agent evaluations (discovers `*_eval.py` / `eval_*.py`, writes HTML + JSON to `eval_reports/`) and project tests (pytest).
Run agent evaluations (discovers `*_eval.py` / `eval_*.py`, writes JSON and HTML reports to `eval_reports/` and opens the HTML report; `--no-open` skips that) and project tests (pytest).

```bash
10xgraph eval --parallel --threshold 0.8
Expand Down Expand Up @@ -447,7 +447,6 @@ Security features of the server:
```bash
MODE=production # production mode
JWT_SECRET_KEY=<32+ chars> # strong secret (secrets.token_urlsafe(32))
IS_DEBUG=false # disable debug
ORIGINS=https://yourdomain.com # specific CORS origins (never *)
ALLOWED_HOST=yourdomain.com # specific allowed hosts (never *)
DOCS_PATH= # recommended: disable API docs
Expand Down Expand Up @@ -528,7 +527,7 @@ sdist + wheel, checks the distribution metadata, and creates a GitHub Release wi
notes and the artifacts attached. PyPI publishing is manual (`make publish`).

```bash
git tag v1.0.0rc1 && git push origin v1.0.0rc1
git tag v1.0.0rc2 && git push origin v1.0.0rc2
```

---
Expand Down
Loading
Loading