Experimental Rust AI developer agent with persistent project memory, Solana tooling, Axum/PostgreSQL backend, and Next.js.
0
stars
7
commits
Rust
primary language
Aug 11, 2026
updated
An experimental Rust-based AI developer agent with Solana tooling, persistent project memory, and a full-stack local control plane.
NeuRust is an experimental portfolio project under development. It is intended to demonstrate Rust backend, CLI, AI-integration, PostgreSQL, and Solana-oriented engineering work; it is not production-ready and is not presented as a production authentication, payment, deployment, or security product.
The current portfolio scope is deliberately smaller than the original product idea. Planned surfaces such as a VS Code extension and a full synchronized dashboard are not implemented in the tracked repository.
NeuRust explores what an AI-assisted developer workflow looks like when the control plane is Rust-first rather than a thin scripting wrapper. The CLI can carry bounded repository context, retain small project-scoped memory, request structured plans or audits, and stream responses through a Rust/Axum service.
The project also explores Solana-focused developer ergonomics. The current implementation keeps that surface intentionally narrow: devnet-oriented CLI helpers, a browser wallet/device-link demo, and experimental backend research code rather than an autonomous deployment system.
Source-verified capabilities in the current repository include:
rustyline REPL and one-shot prompts.cargo audit, reads a target source file, and sends the combined context to the backend..neurust/memory.json, including a bounded rolling summary and semantic pins.The source also contains experimental billing/credit, admin, SOL top-up verification, and backend project-scaffolding code. Those areas are retained as research code and are not presented here as finished product features.
NeuRust currently uses a small custom argument/slash-command parser; it does not use Clap.
# Interactive REPL
cargo run -p neurust-cli
# One-shot AI prompt
cargo run -p neurust-cli -- "Explain the ownership issue in src/main.rs"
# Real slash commands from the current parser
cargo run -p neurust-cli -- /help
cargo run -p neurust-cli -- /auth login
cargo run -p neurust-cli -- /audit neurust-cli/src/main.rs
cargo run -p neurust-cli -- /solana help
cargo run -p neurust-cli -- /solana balance
cargo run -p neurust-cli -- /solana airdrop 2
cargo run -p neurust-cli -- /solana deploy-devnet
# Global UI flags parsed by the CLI
cargo run -p neurust-cli -- --no-stream "Review this Rust workspace structure"
cargo run -p neurust-cli -- --verbose "Explain this build error"
The explicit scaffold command is also implemented:
cargo run -p neurust-cli -- /create "Create a small Rust CLI named hello-neurust"
/create is a write-capable experimental path: it may run scaffold commands and create files in the current working area. Review the target directory and generated plan before using it.
flowchart LR
D[Developer]
C["neurust-cli<br/>Rust REPL / one-shot"]
W["neurust-web<br/>Next.js"]
S["neurust-server<br/>Axum"]
O[OpenRouter]
P[(PostgreSQL)]
K[Solana / Anchor CLIs]
R[Solana JSON-RPC]
D --> C
D --> W
C -->|HTTP + SSE| S
W -->|device-link + proxy routes| S
S --> O
S --> P
C -->|/solana helpers| K
S -. experimental top-up verification .-> R
The main AI path is:
CLI -> Rust/Axum service -> OpenRouter, with PostgreSQL used by the service for users, usage/billing research data, device-flow state, and the documentation knowledge store. The CLI separately keeps small project-local memory on disk.
The Next.js application is currently a limited companion surface rather than a full dashboard. It provides the portfolio landing page, a devnet wallet/device-link demo, and server-side proxy handlers for plan/audit API calls.
solana/anchor CLIsInstall:
The /solana commands additionally require the Solana CLI, and /solana deploy-devnet requires Anchor CLI.
git clone https://github.com/rock19380-ai/neurust-workspace.git
cd neurust-workspace
cp .env.example .env
Edit .env and set at minimum:
OPENROUTER_API_KEY=your_openrouter_api_key_here
The tracked .env.example contains local-development values for the Docker Compose database, model defaults, and local URLs. Do not commit .env or real credentials. The Rust server loads the root .env; the CLI and Next.js app rely on their own process environment/defaults as described below.
docker compose -f neurust-server/docker-compose.yml up -d db
until docker compose -f neurust-server/docker-compose.yml exec -T db \
pg_isready -U neurust_user -d neurust_db >/dev/null 2>&1
do
sleep 1
done
for migration in neurust-server/migrations/*.sql; do
echo "Applying ${migration}"
docker compose -f neurust-server/docker-compose.yml exec -T db \
psql \
-U neurust_user \
-d neurust_db \
-v ON_ERROR_STOP=1 \
--single-transaction \
< "${migration}"
done
NeuRust currently uses SQLx compile-time query macros without checked-in offline query metadata, so a fresh database must have the tracked schema applied before compiling the Rust workspace. The server still runs the embedded SQLx migrator during startup; the tracked migration is written to be idempotent.
cargo run -p neurust-server
The server connects to DATABASE_URL, runs the embedded SQLx migrator, and then starts the application.
The current server also starts the experimental documentation refresh scheduler, which performs network requests to the configured source list.
In another terminal:
cd neurust-web
npm ci
npm run dev
The web app defaults to http://localhost:3000. Its checked-in code already defaults to the local Rust server URLs, so no web env file is required for the default setup. To override them, create neurust-web/.env.local or export the variables before running Next.js.
In another terminal, from the repository root:
cargo run -p neurust-cli -- /auth login
The CLI prints a browser URL and device code. Open the URL, connect a development wallet, and submit the code. This flow associates a public wallet address with the device code; it does not prove wallet ownership cryptographically.
After linking:
cargo run -p neurust-cli -- "Explain this workspace architecture"
Project-specific environment variables currently read by the code are listed below. Defaults are implementation defaults unless noted otherwise. neurust-server loads the root .env with dotenv; CLI overrides such as NEURUST_API_URL must be exported in the CLI process environment, and Next.js overrides belong in neurust-web/.env.local (or its process environment).
| Variable | Requirement | Current use / default |
|---|---|---|
DATABASE_URL | Required at server startup | PostgreSQL connection used by SQLx. The example points at the Compose database. |
OPENROUTER_API_KEY | Required at server startup | OpenRouter bearer credential used by AiService. |
PORT | Optional | Axum bind port; defaults to 8000. |
CLIENT_URL | Optional | Browser base URL embedded in device-link responses; defaults to http://localhost:3000. |
NEURUST_API_URL | Optional | CLI base URL for neurust-server; defaults to http://localhost:8000. |
NEURUST_SERVER_URL | Optional | Next.js server-side plan/audit proxy target; defaults to http://127.0.0.1:8000. |
NEXT_PUBLIC_NEURUST_SERVER_URL | Optional | Browser-side device-link server URL; defaults to http://localhost:8000. |
MODEL_CHAT | Optional | General-chat model override. |
MODEL_DOMAIN | Optional | Domain/coding-oriented model override. |
MODEL_THINKING | Optional | Plan/reasoning model override and streaming billing hint. |
MODEL_CODING | Optional | Audit billing/model hint override. |
MODEL_STRUCTURE | Optional | Structure-oriented model override; otherwise follows the thinking model. |
MODEL_PRICING_JSON | Optional | JSON pricing map used by the experimental usage-cost estimator. |
SOLANA_RPC_URL | Optional for server startup | Used only by the experimental SOL top-up verifier. The code falls back to mainnet-beta if unset; .env.example explicitly pins devnet for local development. |
TREASURY_WALLET | Required only for /api/payment/deposit | Public destination wallet for the experimental SOL top-up verifier. |
SUPER_ADMIN_WALLET | Optional | Experimental local mapping from an x-neurust-wallet value to super_admin; this is not production authentication. |
PROJECT_ROOT | Optional | Filesystem root for backend project-scaffolding experiments; defaults to the current directory. |
ADMIN_FREE_ENABLED | Optional | Experimental billing/admin policy flag; defaults to true. |
TEAM_ADMIN_DAILY_COST_CAP_USD | Optional | Experimental admin-team daily cap; defaults to 10. |
TEAM_ADMIN_MONTHLY_COST_CAP_USD | Optional | Experimental admin-team monthly cap; defaults to 200. |
neurust-workspace/
├── Cargo.toml # Rust workspace: CLI + server
├── .env.example # Local development configuration template
├── PROJECT_GOALS.md # Scope boundaries and future direction
├── neurust-cli/ # Interactive / one-shot Rust developer CLI
│ └── src/
│ ├── commands/ # ask, audit, auth, create, Solana helpers
│ ├── api/ # Axum server HTTP/SSE client
│ └── utils/ # context, memory, command execution, REPL
├── neurust-server/ # Axum + SQLx/PostgreSQL backend
│ ├── migrations/ # Embedded SQLx schema migration
│ ├── data/sources.json # Experimental knowledge-refresh source list
│ └── src/
│ ├── handlers/ # auth, agent, project, payment, admin routes
│ ├── middleware/ # experimental wallet-header/admin gates
│ └── services/ # AI, billing research, RAG, scraper, scheduler
└── neurust-web/ # Limited Next.js portfolio/device-link surface
├── app/ # landing, login, plan/audit proxy routes
└── components/ # landing, wallet provider, shared UI
The original VS Code extension is a roadmap item; there is no tracked extension implementation in the current repository.
NeuRust should be treated as operator-reviewed developer tooling, not an autonomous production agent.
Apply this plan now?, defaulting to No.cargo, npm, npx, pnpm, yarn, docker, git) present an additional run-or-skip prompt before execution./create workflow is less uniformly guarded: after requesting a plan it can scaffold and write files directly, and not every possible external command is covered by the heavy-command confirmation list./solana deploy-devnet intentionally invokes the user's installed Anchor CLI to build and deploy to devnet. NeuRust does not generate, import, or store Solana private keys, but the external CLI may use whatever signer the developer has configured.x-neurust-wallet header after a public-address linking flow. It does not perform cryptographic wallet-ownership verification and is not a production authorization boundary.Any origin, methods, and headers)./create and backend scaffolding are experimental write paths and do not provide a universal per-file approval model./audit depends on an externally installed cargo-audit for dependency scanning; if unavailable, that phase is skipped.solana and anchor tools. The CLI helpers are devnet-oriented, while the experimental backend top-up verifier falls back to mainnet-beta unless SOLANA_RPC_URL is explicitly configured.Future work that is not implemented today includes:
GitHub Actions runs the same Rust and web quality gates on pull requests and on pushes to main. The Rust job uses a disposable PostgreSQL 15 service because the checked-in SQLx query macros validate against a live schema at compile time; CI applies the tracked migrations before cargo check, Clippy, and tests. No OpenRouter key is configured, and these checks do not invoke a paid AI request.
From the repository root:
cargo fmt --all -- --check
cargo check --workspace --all-targets
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --all-targets
For the Next.js application:
cd neurust-web
npm ci
npm run lint
npm run build
cd ..
Repository hygiene checks used for this portfolio hardening phase:
git diff --check
git status --short
git diff --stat
7 commits
Rust
89.3%
TypeScript
6.9%
PLpgSQL
3.5%
Experimental Rust AI developer agent with persistent project memory, Solana tooling, Axum/PostgreSQL backend, and Next.js.
0
stars
7
commits
Rust
primary language
Aug 11, 2026
updated
An experimental Rust-based AI developer agent with Solana tooling, persistent project memory, and a full-stack local control plane.
NeuRust is an experimental portfolio project under development. It is intended to demonstrate Rust backend, CLI, AI-integration, PostgreSQL, and Solana-oriented engineering work; it is not production-ready and is not presented as a production authentication, payment, deployment, or security product.
The current portfolio scope is deliberately smaller than the original product idea. Planned surfaces such as a VS Code extension and a full synchronized dashboard are not implemented in the tracked repository.
NeuRust explores what an AI-assisted developer workflow looks like when the control plane is Rust-first rather than a thin scripting wrapper. The CLI can carry bounded repository context, retain small project-scoped memory, request structured plans or audits, and stream responses through a Rust/Axum service.
The project also explores Solana-focused developer ergonomics. The current implementation keeps that surface intentionally narrow: devnet-oriented CLI helpers, a browser wallet/device-link demo, and experimental backend research code rather than an autonomous deployment system.
Source-verified capabilities in the current repository include:
rustyline REPL and one-shot prompts.cargo audit, reads a target source file, and sends the combined context to the backend..neurust/memory.json, including a bounded rolling summary and semantic pins.The source also contains experimental billing/credit, admin, SOL top-up verification, and backend project-scaffolding code. Those areas are retained as research code and are not presented here as finished product features.
NeuRust currently uses a small custom argument/slash-command parser; it does not use Clap.
# Interactive REPL
cargo run -p neurust-cli
# One-shot AI prompt
cargo run -p neurust-cli -- "Explain the ownership issue in src/main.rs"
# Real slash commands from the current parser
cargo run -p neurust-cli -- /help
cargo run -p neurust-cli -- /auth login
cargo run -p neurust-cli -- /audit neurust-cli/src/main.rs
cargo run -p neurust-cli -- /solana help
cargo run -p neurust-cli -- /solana balance
cargo run -p neurust-cli -- /solana airdrop 2
cargo run -p neurust-cli -- /solana deploy-devnet
# Global UI flags parsed by the CLI
cargo run -p neurust-cli -- --no-stream "Review this Rust workspace structure"
cargo run -p neurust-cli -- --verbose "Explain this build error"
The explicit scaffold command is also implemented:
cargo run -p neurust-cli -- /create "Create a small Rust CLI named hello-neurust"
/create is a write-capable experimental path: it may run scaffold commands and create files in the current working area. Review the target directory and generated plan before using it.
flowchart LR
D[Developer]
C["neurust-cli<br/>Rust REPL / one-shot"]
W["neurust-web<br/>Next.js"]
S["neurust-server<br/>Axum"]
O[OpenRouter]
P[(PostgreSQL)]
K[Solana / Anchor CLIs]
R[Solana JSON-RPC]
D --> C
D --> W
C -->|HTTP + SSE| S
W -->|device-link + proxy routes| S
S --> O
S --> P
C -->|/solana helpers| K
S -. experimental top-up verification .-> R
The main AI path is:
CLI -> Rust/Axum service -> OpenRouter, with PostgreSQL used by the service for users, usage/billing research data, device-flow state, and the documentation knowledge store. The CLI separately keeps small project-local memory on disk.
The Next.js application is currently a limited companion surface rather than a full dashboard. It provides the portfolio landing page, a devnet wallet/device-link demo, and server-side proxy handlers for plan/audit API calls.
solana/anchor CLIsInstall:
The /solana commands additionally require the Solana CLI, and /solana deploy-devnet requires Anchor CLI.
git clone https://github.com/rock19380-ai/neurust-workspace.git
cd neurust-workspace
cp .env.example .env
Edit .env and set at minimum:
OPENROUTER_API_KEY=your_openrouter_api_key_here
The tracked .env.example contains local-development values for the Docker Compose database, model defaults, and local URLs. Do not commit .env or real credentials. The Rust server loads the root .env; the CLI and Next.js app rely on their own process environment/defaults as described below.
docker compose -f neurust-server/docker-compose.yml up -d db
until docker compose -f neurust-server/docker-compose.yml exec -T db \
pg_isready -U neurust_user -d neurust_db >/dev/null 2>&1
do
sleep 1
done
for migration in neurust-server/migrations/*.sql; do
echo "Applying ${migration}"
docker compose -f neurust-server/docker-compose.yml exec -T db \
psql \
-U neurust_user \
-d neurust_db \
-v ON_ERROR_STOP=1 \
--single-transaction \
< "${migration}"
done
NeuRust currently uses SQLx compile-time query macros without checked-in offline query metadata, so a fresh database must have the tracked schema applied before compiling the Rust workspace. The server still runs the embedded SQLx migrator during startup; the tracked migration is written to be idempotent.
cargo run -p neurust-server
The server connects to DATABASE_URL, runs the embedded SQLx migrator, and then starts the application.
The current server also starts the experimental documentation refresh scheduler, which performs network requests to the configured source list.
In another terminal:
cd neurust-web
npm ci
npm run dev
The web app defaults to http://localhost:3000. Its checked-in code already defaults to the local Rust server URLs, so no web env file is required for the default setup. To override them, create neurust-web/.env.local or export the variables before running Next.js.
In another terminal, from the repository root:
cargo run -p neurust-cli -- /auth login
The CLI prints a browser URL and device code. Open the URL, connect a development wallet, and submit the code. This flow associates a public wallet address with the device code; it does not prove wallet ownership cryptographically.
After linking:
cargo run -p neurust-cli -- "Explain this workspace architecture"
Project-specific environment variables currently read by the code are listed below. Defaults are implementation defaults unless noted otherwise. neurust-server loads the root .env with dotenv; CLI overrides such as NEURUST_API_URL must be exported in the CLI process environment, and Next.js overrides belong in neurust-web/.env.local (or its process environment).
| Variable | Requirement | Current use / default |
|---|---|---|
DATABASE_URL | Required at server startup | PostgreSQL connection used by SQLx. The example points at the Compose database. |
OPENROUTER_API_KEY | Required at server startup | OpenRouter bearer credential used by AiService. |
PORT | Optional | Axum bind port; defaults to 8000. |
CLIENT_URL | Optional | Browser base URL embedded in device-link responses; defaults to http://localhost:3000. |
NEURUST_API_URL | Optional | CLI base URL for neurust-server; defaults to http://localhost:8000. |
NEURUST_SERVER_URL | Optional | Next.js server-side plan/audit proxy target; defaults to http://127.0.0.1:8000. |
NEXT_PUBLIC_NEURUST_SERVER_URL | Optional | Browser-side device-link server URL; defaults to http://localhost:8000. |
MODEL_CHAT | Optional | General-chat model override. |
MODEL_DOMAIN | Optional | Domain/coding-oriented model override. |
MODEL_THINKING | Optional | Plan/reasoning model override and streaming billing hint. |
MODEL_CODING | Optional | Audit billing/model hint override. |
MODEL_STRUCTURE | Optional | Structure-oriented model override; otherwise follows the thinking model. |
MODEL_PRICING_JSON | Optional | JSON pricing map used by the experimental usage-cost estimator. |
SOLANA_RPC_URL | Optional for server startup | Used only by the experimental SOL top-up verifier. The code falls back to mainnet-beta if unset; .env.example explicitly pins devnet for local development. |
TREASURY_WALLET | Required only for /api/payment/deposit | Public destination wallet for the experimental SOL top-up verifier. |
SUPER_ADMIN_WALLET | Optional | Experimental local mapping from an x-neurust-wallet value to super_admin; this is not production authentication. |
PROJECT_ROOT | Optional | Filesystem root for backend project-scaffolding experiments; defaults to the current directory. |
ADMIN_FREE_ENABLED | Optional | Experimental billing/admin policy flag; defaults to true. |
TEAM_ADMIN_DAILY_COST_CAP_USD | Optional | Experimental admin-team daily cap; defaults to 10. |
TEAM_ADMIN_MONTHLY_COST_CAP_USD | Optional | Experimental admin-team monthly cap; defaults to 200. |
neurust-workspace/
├── Cargo.toml # Rust workspace: CLI + server
├── .env.example # Local development configuration template
├── PROJECT_GOALS.md # Scope boundaries and future direction
├── neurust-cli/ # Interactive / one-shot Rust developer CLI
│ └── src/
│ ├── commands/ # ask, audit, auth, create, Solana helpers
│ ├── api/ # Axum server HTTP/SSE client
│ └── utils/ # context, memory, command execution, REPL
├── neurust-server/ # Axum + SQLx/PostgreSQL backend
│ ├── migrations/ # Embedded SQLx schema migration
│ ├── data/sources.json # Experimental knowledge-refresh source list
│ └── src/
│ ├── handlers/ # auth, agent, project, payment, admin routes
│ ├── middleware/ # experimental wallet-header/admin gates
│ └── services/ # AI, billing research, RAG, scraper, scheduler
└── neurust-web/ # Limited Next.js portfolio/device-link surface
├── app/ # landing, login, plan/audit proxy routes
└── components/ # landing, wallet provider, shared UI
The original VS Code extension is a roadmap item; there is no tracked extension implementation in the current repository.
NeuRust should be treated as operator-reviewed developer tooling, not an autonomous production agent.
Apply this plan now?, defaulting to No.cargo, npm, npx, pnpm, yarn, docker, git) present an additional run-or-skip prompt before execution./create workflow is less uniformly guarded: after requesting a plan it can scaffold and write files directly, and not every possible external command is covered by the heavy-command confirmation list./solana deploy-devnet intentionally invokes the user's installed Anchor CLI to build and deploy to devnet. NeuRust does not generate, import, or store Solana private keys, but the external CLI may use whatever signer the developer has configured.x-neurust-wallet header after a public-address linking flow. It does not perform cryptographic wallet-ownership verification and is not a production authorization boundary.Any origin, methods, and headers)./create and backend scaffolding are experimental write paths and do not provide a universal per-file approval model./audit depends on an externally installed cargo-audit for dependency scanning; if unavailable, that phase is skipped.solana and anchor tools. The CLI helpers are devnet-oriented, while the experimental backend top-up verifier falls back to mainnet-beta unless SOLANA_RPC_URL is explicitly configured.Future work that is not implemented today includes:
GitHub Actions runs the same Rust and web quality gates on pull requests and on pushes to main. The Rust job uses a disposable PostgreSQL 15 service because the checked-in SQLx query macros validate against a live schema at compile time; CI applies the tracked migrations before cargo check, Clippy, and tests. No OpenRouter key is configured, and these checks do not invoke a paid AI request.
From the repository root:
cargo fmt --all -- --check
cargo check --workspace --all-targets
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --all-targets
For the Next.js application:
cd neurust-web
npm ci
npm run lint
npm run build
cd ..
Repository hygiene checks used for this portfolio hardening phase:
git diff --check
git status --short
git diff --stat
7 commits
Rust
89.3%
TypeScript
6.9%
PLpgSQL
3.5%