Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / README.md |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | 840945d70b88674d8f40d330001cc63d871dc8e2 |
| Branch | codex/build-online-github-ani-nbgsix |
| Path or archive member | README.md |
| Original SHA-256 | c5f7a5bdbfc613e24fd3c6c68c61a50d3020c31c52e4ef371ec749b07bdad0f1 |
| Git blob SHA | 5aabbd7d23a809b344f42f295bf125d8576bf5b7 |
| Reading-copy SHA-256 | c5f7a5bdbfc613e24fd3c6c68c61a50d3020c31c52e4ef371ec749b07bdad0f1 |
Recovered source transcript
Download complete source text ↓74 lines · 5.8 KB
# AI_Brain
Seeding suite for Hive's 500× expansion. Inserts atomically hashed sentences into Postgres `atomic_facts` with ON CONFLICT DO NOTHING.
## Features
- 12-factor env config; dry-run support via `DRY_RUN=1`.
- File-based seeding (`SEED_FILE[_CATEGORY]`) or programmatic generators (math, agent, language, prophecy, marketing).
- Online marketing intelligence endpoint that ranks curated campaigns against prompts.
- Statistical marketing intelligence endpoint delivering benchmark-weighted ROI and CTR projections.
- Multi-process marketing ANI surface pairing retrieval-augmented guidance (RAG), an Experiment Growth Grid (EGG) planner, optional Google Ads enrichment, CJ affiliate monetization intelligence, crypto market telemetry, Stripe monetization playbooks, Amazon marketplace merchandising, and AWS revenue automation.
- Crypto market telemetry layer that synthesizes CoinGecko, CoinCap, Blockstream, and BlockCypher data into actionable asset snapshots for campaigns.
- Stripe monetization planner that converts campaign selections into checkout-ready offers (activates live mode when Stripe SDK credentials are configured).
- Amazon and AWS data pipelines with curated marketplace catalogs and growth playbooks that flip to live SDK-backed enrichment when credentials are supplied.
- Atomic SHA-256 hashing and idempotent inserts.
- Simple launcher: `daemon/seed_all.sh --env file --dry-run --only math,agent,marketing,...`.
## Quick Start
1. Python deps (for live DB):
- `python3 -m pip install --user -r requirements.txt`
2. Create schema:
- `psql -h "$PGHOST" -U "$PGUSER" -d "$PGDATABASE" -f infra/seed.sql`
3. Dry-run with examples:
- `daemon/seed_all.sh --env .env.example --dry-run`
4. Live (set your own `.env`):
- `daemon/seed_all.sh --env .env`
## Env Vars
- PGHOST, PGDATABASE, PGUSER, PGPORT
- DRY_RUN (1 to simulate)
- SEED_SOURCE (default `Hive500Expansion`)
- SEED_FILE, SEED_FILE_MATH_MODEL, SEED_FILE_AGENT, SEED_FILE_LANGUAGE, SEED_FILE_PROPHECY, SEED_FILE_MARKETING
- GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_CUSTOMER_ID, GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_REFRESH_TOKEN, GOOGLE_ADS_LOGIN_CUSTOMER_ID (optional OAuth credentials for live Google Ads metrics)
- GOOGLE_ADS_SERVICE_ACCOUNT_INFO, GOOGLE_ADS_SERVICE_ACCOUNT_FILE, or GOOGLE_ADS_SERVICE_ACCOUNT_B64 (service account options for Google Ads SDK authentication; honors GOOGLE_APPLICATION_CREDENTIALS)
- CJ_DEVELOPER_KEY (required for live CJ publisher API access)
- CJ_WEBSITE_ID, CJ_ACCOUNT_ID (optional metadata forwarded to CJ API requests)
- STRIPE_API_KEY (activates live Stripe monetization orchestration)
- STRIPE_ACCOUNT_ID (optional Stripe account hint for logging/analytics)
- AMAZON_PAAPI_ACCESS_KEY, AMAZON_PAAPI_SECRET_KEY, AMAZON_PAAPI_PARTNER_TAG (enables live Amazon Product Advertising API harvesting)
- AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN (optional) (activates boto3-backed AWS revenue automation validation)
- AWS_REGION, AWS_PROFILE (optional session tuning for AWS integrations)
See `.env.example` for a template.
## Make Targets
- `make enumerations` – generate 5×500 lists under `daemon/enumerations/`
- `make seed-dry` – dry-run using `.env.example`
- `make seed-live` – live run using `.env` (ensure DB is reachable)
## Testing
- `python -m pip install -r requirements-dev.txt`
- `pytest`
## Intelligence API
The marketing ANI runs within the FastAPI service and now includes a statistical surface.
- Run locally: `uvicorn services.seeder_api.app:app --reload`
- Baseline ranking endpoint: `curl -X POST http://localhost:8000/intelligence/marketing -H 'Content-Type: application/json' -d '{"prompt": "accelerate demos for B2B SaaS founders"}'`
- Statistical endpoint with ROI/CTR projections: `curl -X POST http://localhost:8000/intelligence/marketing/statistical -H 'Content-Type: application/json' -d '{"prompt": "Optimize ROI for AI founders"}'`
- Statistical responses include campaign-level ROI, CTR, confidence estimates, and a portfolio rollup summarizing the blended strategy.
- Diagnostics endpoint for prompt intelligence: `curl -X POST http://localhost:8000/intelligence/marketing/diagnostics -H 'Content-Type: application/json' -d '{"prompt": "Pipeline is stalled for B2B founders"}'`
- Diagnostic responses label funnel stage, urgency, ICP focus, recommended KPIs, opportunity plays, and risk signals to accelerate decisioning.
- Process orchestration endpoint for RAG + EGG + Google Ads + CJ affiliate + crypto market + Stripe + Amazon marketplace + AWS revenue intelligence: `curl -X POST http://localhost:8000/intelligence/marketing/processes -H 'Content-Type: application/json' -d '{"prompt": "Need urgent conversion plays for enterprise SaaS"}'`
- Process responses include a `rag` block with prioritized campaigns, an `egg` array of experiment playbooks, a `google_ads` collection containing either live Google Ads performance (when credentials are configured) or benchmark-driven simulations, a `cj_affiliate` catalog with monetizable programs from CJ (live when keys configured, simulated otherwise), `crypto_markets` snapshots summarizing CoinGecko/CoinCap/Blockstream/BlockCypher signals, `stripe` checkout plans that switch to live Stripe SDK execution when credentials are available, `amazon_marketplace` merchandising plays from Amazon Product Advertising/AWS Marketplace sources, and `aws_cloud` revenue automation programs sourced from AWS growth playbooks or live boto3 validation.
## Continuous Integration
This repository is wired up with a GitHub Actions workflow (`CI`) that runs on
every push and pull request. The workflow installs the project dependencies,
executes the dry-run seeding smoke test (`make seed-dry`), runs the automated
pytest suite, and compiles the Python sources to validate imports. This provides
quick feedback that seeding pipelines and services stay healthy before changes
are merged.