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 | 11aa50ef5d7692e8abd1b8d74ae31c5c29201b14 |
| Branch | codex/build-online-github-ani-irqa7y |
| Path or archive member | README.md |
| Original SHA-256 | 0d21fbc9830da18bb7839a1c0955dab8bec0baba457bc07ef906b1124fa72679 |
| Git blob SHA | 6b5c3a508cd5c5e708da8cbea48becbcbb7ff890 |
| Reading-copy SHA-256 | 0d21fbc9830da18bb7839a1c0955dab8bec0baba457bc07ef906b1124fa72679 |
Every recorded occurrence
These 3 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/AI_Brain / README.md | codex/build-online-github-ani-irqa7y | 11aa50ef5d7692e8abd1b8d74ae31c5c29201b14 | Open original |
| Janady13/AI_Brain / README.md | codex/build-online-github-ani-0etkns | e250b19d446bdffd542c9eea31cead12e30800d6 | Open original |
| Janady13/AI_Brain / README.md | codex/build-online-github-ani-irqa7y | 11aa50ef5d7692e8abd1b8d74ae31c5c29201b14 | Open original |
Recovered source transcript
Download complete source text ↓101 lines · 12.3 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, PayPal payout orchestration, influencer collaboration intelligence, Amazon marketplace merchandising, eBay partner commerce intelligence, AWS revenue automation, and an autonomous budget allocator.
- Budget allocation engine that synthesizes channel investment benchmarks with prompt intent to recommend spend mix, projected revenue, and payback timelines.
- Autonomous automation sprint planner that converts ranked campaigns into a three-hour execution loop across the strongest channels.
- Closed-loop learning loop that distills historic experiment memory into next actions aligned to each prompt.
- Competitive landscape intelligence that surfaces rival plays, threat levels, and counter-moves from curated monitoring feeds.
- Executive playbook orchestrator that fuses every enrichment signal into prioritized directives with budgets, actions, and risk mitigation.
- Crypto market telemetry layer that synthesizes CoinGecko, CoinCap, Blockstream, and BlockCypher data into actionable asset snapshots for campaigns.
- Global stock market and bitcoin forecasting layer that converts curated macro datasets into statistical 30/90-day return outlooks and revenue multipliers.
- Statistical reasoning engine that blends curated priors with live campaign performance, projects success probabilities, and optionally persists insights to Postgres for longitudinal learning.
- Stripe monetization planner that converts campaign selections into checkout-ready offers (activates live mode when Stripe SDK credentials are configured).
- PayPal monetization planner that transforms campaigns into payout-ready flows with configurable payout cadence and merchant linkage.
- Influencer collaboration planner that pairs prompts with curated creator reach, projected ROI, and activation notes, with optional live sourcing when API credentials are provided.
- Amazon and AWS data pipelines with curated marketplace catalogs and growth playbooks that flip to live SDK-backed enrichment when credentials are supplied.
- Marketplace mastery across Amazon (Prime, Buy Box, fulfillment heuristics) and eBay (Top Rated velocity, affiliate margin, shipping speed) plus influencer partnership reach planning so prompts surface revenue-ready partner offers even without live credentials.
- 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
- STATISTICAL_REASONING_PERSIST (set to `1` to persist statistical reasoning summaries into Postgres `statistical_reasoning_insights`)
- 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)
- PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET (activate live PayPal checkout orchestration)
- PAYPAL_MERCHANT_ID (optional merchant account reference used in generated setup steps)
- PAYPAL_ENVIRONMENT (set to `live` to flip from sandbox heuristics)
- AMAZON_PAAPI_ACCESS_KEY, AMAZON_PAAPI_SECRET_KEY, AMAZON_PAAPI_PARTNER_TAG (enables live Amazon Product Advertising API harvesting)
- EBAY_APP_ID, EBAY_CERT_ID, EBAY_DEV_ID (required for live eBay Partner Network inventory)
- EBAY_REDIRECT_URI, EBAY_CAMPAIGN_ID (optional partner configuration forwarded to the eBay API)
- 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)
- INFLUENCER_NETWORK_API_KEY (optional API key for sourcing live influencer availability)
- INFLUENCER_NETWORK_WORKSPACE (optional workspace identifier forwarded to influencer network requests)
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 + global stock forecasts + Stripe + PayPal + Amazon marketplace + AWS revenue + budget intelligence + closed-loop learning + competitive counter-moves: `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, `stock_markets` forecasts that merge global equities and bitcoin signals into statistical 30/90-day return projections, `stripe` checkout plans that switch to live Stripe SDK execution when credentials are available, `paypal` payout flows that flip to live PayPal SDK orchestration when credentials are provided, a `cognitive_architecture` array translating machine learning, reasoning, problem-solving, perception, language, prompt engineering, cache-augmented generation, knowledge-augmented generation, Haystack, LlamaIndex, agent automations, vector databases, and prompt management into actionable orchestration steps, an `agentic_systems` payload that fuses agent-based planning, database connectivity, feature stores, vector memory, prompt management hubs, and trading automation into maturity-scored activation plans, `influencer_collaborations` that surface reach, ROI, and activation notes for curated partner creators (upgrade with API credentials), `amazon_marketplace` merchandising plays from Amazon Product Advertising/AWS Marketplace sources, `ebay_marketplace` Top Rated offers tuned for affiliate margin and shipping velocity, `aws_cloud` revenue automation programs sourced from AWS growth playbooks or live boto3 validation, `competitive_landscape` counter-moves summarizing curated rival signals, an `executive_playbook` blueprint that prioritizes directives with dependencies, timelines, and risk mitigation, a `scenario_planning` payload that quantifies optimistic/base/conservative revenue envelopes with accelerators and stabilizers, and a `statistical_reasoning` payload summarizing posterior ROI, success probability, and driver evidence.
- Process responses now also provide a `budget_optimizer` plan that allocates spend across the ranked campaigns with projected leads, revenue, ROI, and payback horizon based on channel investment benchmarks (override `daemon/datasets/channel_investments.json` to customize).
- The `automation` payload delivers a scripted three-hour sprint with sequential tasks, tooling, and KPIs that can drive autonomous execution; update `daemon/datasets/automation_sprints.json` to tailor time blocks or focus overlays.
- The `learning_loop` payload taps into `daemon/datasets/performance_memory.json` and blends funnel diagnostics, campaign rankings, and historic wins/losses into next-action guidance ready for operators or automation cadences.
- The `competitive_landscape` payload leverages `daemon/datasets/competitive_landscape.json` to spotlight rival strengths, weaknesses, and recommended counter-moves; tweak the dataset to match your market intelligence feeds.
- The `stock_markets` payload reads from `daemon/datasets/global_stock_markets.json`, blending global equity and bitcoin benchmarks into forecasted returns—edit this dataset or wire live feeds for bespoke macro coverage.
- The `cognitive_architecture` payload is powered by `daemon/datasets/cognitive_capabilities.json`, mapping machine learning, reasoning, perception, language understanding, prompt engineering, cache-augmented generation, knowledge-augmented generation, Haystack, LlamaIndex, agent applications, vector databases, and prompt management patterns into maturity-scored playbooks.
- The `agentic_systems` payload reads from `daemon/datasets/agentic_systems.json`, translating agent-based orchestration, database fusion, feature store governance, predictive ML labs, market intelligence reactors, CX command centers, and prompt intelligence fabrics into readiness-scored playbooks with toolchains, metrics, and risk controls.
- The `excellence` summary distills ROI, CTR, confidence, and process coverage into a composite maturity index so you can quickly understand how "world-class" a given prompt’s orchestration is and where to reinforce integrations.
- The `scenario_planning` payload feeds the new scenario engine which fuses ranked campaigns, budget allocations, and enrichment telemetry (Google Ads ROAS, CJ revenue, Amazon sentiment, eBay margin velocity, AWS ROI, Stripe pricing, PayPal payout readiness, influencer reach momentum, crypto volatility, stock market trends, cognitive readiness, and agentic tool automation signals) into optimistic, base, and conservative projections. Each projection surfaces accelerators, stabilizers, and watchouts so operators can decide how aggressively to push spend or hedge risk in autonomous loops.
## 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.