Raenest-ready, multi-agent US shares intelligence platform
Built for production workflows: trade sync, portfolio intelligence, AI analysis orchestration, and enterprise handover.
Alex is a production AI system for portfolio intelligence. It now includes a dedicated Raenest integration layer so US-share activity can be synced, analyzed, and surfaced as insights without breaking existing flows.
Core outcomes:
- Trade events can be synced server-to-server into Alex accounts.
- Portfolio intelligence (top holdings, concentration, sector exposure) is returned in API-ready format.
- AI analysis jobs can be triggered from backend workflows and tracked through existing queue/orchestration.
- The frontend is polished for enterprise ownership with operational status and handover views.
graph TB
API[FastAPI Backend] --> Q[SQS Job Queue]
Q --> P[Planner Lambda]
P --> T[Tagger Lambda]
P --> RP[Reporter Lambda]
P --> C[Charter Lambda]
P --> RT[Retirement Lambda]
API --> DB[(Aurora Serverless v2)]
RAENEST[Raenest Backend] -->|sync-trades / trigger-analysis| API
UI[Next.js + Clerk Frontend] --> API
- Structured context engineering with explicit research objective/guardrails.
- Run-scoped to-do tools for plan-execute-verify behavior.
- Source ledger tools for citation discipline.
- Ingestion guard to avoid duplicate writes.
- Runtime controls to reduce App Runner 504 risk:
RESEARCHER_MCP_TIMEOUT_SECONDSRESEARCHER_MAX_TURNSRESEARCHER_REQUEST_TIMEOUT_SECONDS
- Fallback execution path when browsing/tool loops fail.
- Model and region moved to environment-driven configuration.
New secured endpoints in backend/api/main.py:
POST /api/raenest/sync-tradesGET /api/raenest/portfolio-intelligence/{clerk_user_id}POST /api/raenest/trigger-analysis
Key behavior:
- Auto-bootstrap user/account if missing.
- Buy/sell trade application with position upsert and close-out handling.
- Cash and estimated value summaries in USD with optional NGN conversion.
- Risk flags (for example concentration >25%).
- API key guard via
x-raenest-api-key.
- Request ID middleware (
x-request-id) for traceability. - Structured request logs (path, method, status, duration).
- Request ID returned in error responses.
- Readiness endpoint:
GET /api/ops/readiness.
- Repositioned product branding to "Alex for Raenest".
- Added reusable enterprise components:
frontend/components/EnterpriseStatusStrip.tsxfrontend/components/HandoverReadinessCard.tsx
- Updated
dashboard,advisor-team, andanalysispages with status chips, trust language, and operational framing. - Added handover center page:
frontend/pages/handover.tsx. - Introduced reusable style primitives in
frontend/styles/globals.css:
.surface-card,.surface-card-muted.status-chipvariants.enterprise-hero
RAENEST_INTEGRATION.md- integration contracts and flow.ENTERPRISE_HANDOVER.md- ownership model, SLO starter pack, security baseline.UI_HANDOVER.md- design/UI standards and QA checklist.
GET /healthGET /api/ops/readiness
POST /api/raenest/sync-tradesGET /api/raenest/portfolio-intelligence/{clerk_user_id}POST /api/raenest/trigger-analysis
All /api/raenest/* endpoints require:
x-raenest-api-key: <RAENEST_API_KEY>Important environment variables:
# Bedrock and model
BEDROCK_MODEL_ID=openai.gpt-oss-120b-1:0
BEDROCK_REGION=us-west-2
# Researcher resilience controls
RESEARCHER_MCP_TIMEOUT_SECONDS=30
RESEARCHER_MAX_TURNS=14
RESEARCHER_REQUEST_TIMEOUT_SECONDS=75
# Integration security
RAENEST_API_KEY=replace_with_strong_server_side_keyFollow the guides in order:
guides/1_permissions.mdguides/2_sagemaker.mdguides/3_ingest.mdguides/4_researcher.mdguides/5_database.mdguides/6_agents.mdguides/7_frontend.mdguides/8_enterprise.md
Each Terraform directory is independent and requires its own terraform.tfvars.
Latest checks run successfully:
frontend:npm run lintfrontend:npm run buildbackend/api:uv run uvicorn main:app --help
- Keep
RAENEST_API_KEYserver-side only. - Rotate keys/secrets regularly.
- Apply least-privilege IAM policies.
- Add WAF/IP allowlist for server-to-server endpoints where possible.
- Preserve request IDs in incident workflows for auditability.
This project is educational and operationally oriented.
It does not provide financial advice. Always involve qualified compliance and investment professionals before production use.