{"id":"b72562df-bfbc-4587-8711-c38e25572bea","entityType":"agent","slug":"crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent","name":"Generative-and-Agentic-AI_Alpha-Agent","canonicalUrl":"https://www.xpersona.co/agent/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent","canonicalPath":"/agent/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent","generatedAt":"2026-10-10T05:00:03.793Z","source":"GITHUB_REPOS","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T18:04:02.078Z","emptyReason":null},"description":"A multi-agent equity research co-pilot : GRU forecasting, fine-tuned sentiment analysis, and citation-grounded RAG over real SEBI regulations, orchestrated by CrewAI agents that reason honestly about their own signal quality. AlphaAgent **A multi-agent equity research & portfolio co-pilot.** AlphaAgent mimics a buy-side equity research desk: four specialized AI agents (Quant, Sentiment, Compliance, Strategist) collaborate to turn a question like *\"Should I be concerned about RELIANCE.NS's exposure given recent regulatory and market developments?\"* into a grounded, citation-backed recommendation — with every claim traceable back to a speci","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. Last updated 10/9/2026.","installCommand":null,"sourceUrl":"https://github.com/arattrika-dey-ad/Generative-and-Agentic-AI_Alpha-Agent","homepage":null,"primaryLinks":[{"label":"View Source","url":"https://github.com/arattrika-dey-ad/Generative-and-Agentic-AI_Alpha-Agent","kind":"source"}],"safetyScore":66,"overallRank":18.8,"popularityScore":0,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"A multi-agent equity research co-pilot : GRU forecasting, fine-tuned sentiment analysis, and citation-grounded RAG over real SEBI regulations, orchestrated by C"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:04:02.078Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[{"label":"crewai","status":"self-declared"},{"label":"multi-agent","status":"self-declared"}],"verifiedCount":0,"selfDeclaredCount":3,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"},{"key":"crewai","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"},{"key":"multi-agent","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile capability:crewai|supported|profile capability:multi-agent|supported|profile"}},"adoption":{"evidence":{"source":"no-adoption-signals","verified":false,"confidence":"low","updatedAt":"2026-10-09T18:04:02.078Z","emptyReason":"No source adoption metrics were available."},"stars":0,"forks":0,"downloads":null,"packageName":null,"latestVersion":null,"tractionLabel":null},"release":{"evidence":{"source":"agent-index","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:04:02.070Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T18:04:02.078Z","lastCrawledAt":"2026-10-09T18:04:02.070Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-16T18:04:02.070Z","lastVerifiedAt":null,"highlights":[]},"execution":{"evidence":{"source":"GITHUB REPOS","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":null,"setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"GITHUB_REPOS","generatedAt":"2026-10-10T05:00:03.793Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/crewai-arattrika-dey-ad-generative-and-agentic-ai-alpha-agent/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"GITHUB REPOS","verified":false,"confidence":"high","updatedAt":"2026-10-09T18:04:02.078Z","emptyReason":null},"readme":"# AlphaAgent\n\n**A multi-agent equity research & portfolio co-pilot.**\n\nAlphaAgent mimics a buy-side equity research desk: four specialized AI agents (Quant, Sentiment, Compliance, Strategist) collaborate to turn a question like *\"Should I be concerned about RELIANCE.NS's exposure given recent regulatory and market developments?\"* into a grounded, citation-backed recommendation — with every claim traceable back to a specific model, dataset, or SEBI circular, and every disagreement between agents named explicitly rather than smoothed over.\n\nThis is a from-scratch build across six phases: a NumPy neural net with manual backprop, a PyTorch GRU forecaster, a fine-tuned DistilBERT sentiment model, a citation-grounded RAG pipeline over real SEBI circulars, a CrewAI multi-agent orchestration layer, and this dashboard. See [`PROJECT_BRIEF.md`](PROJECT_BRIEF.md) for the full phase-by-phase spec this was built against.\n\n---\n\n## Architecture\n\n```mermaid\nflowchart TD\n    subgraph P1[\"Phase 1-2: Ingestion + Forecasting\"]\n        A1[\"ingest_prices.py<br/>yfinance OHLCV, 8 NSE tickers\"]\n        A2[\"ingest_news.py<br/>GDELT headlines\"]\n        A3[\"ingest_filings.py<br/>10 real SEBI circulars\"]\n        B1[\"forecaster_nn.py<br/>NumPy NN, manual backprop\"]\n        B2[\"forecaster_rnn.py<br/>PyTorch GRU\"]\n    end\n\n    subgraph P3[\"Phase 3: Fine-tuning + LLM Layer\"]\n        C1[\"sentiment_finetune.py<br/>fine-tuned DistilBERT\"]\n        C2[\"decoding_comparison.py<br/>greedy / beam / nucleus\"]\n    end\n\n    subgraph P4[\"Phase 4: RAG Layer\"]\n        D1[\"chunking.py + vector_store.py<br/>Chroma + all-MiniLM-L6-v2\"]\n        D2[\"langchain_pipelines.py<br/>grounded chain, Gemini 2.5 Flash\"]\n    end\n\n    subgraph P5[\"Phase 5: CrewAI Agents\"]\n        E1[\"Quant Agent\"]\n        E2[\"Sentiment Agent\"]\n        E3[\"Compliance Agent\"]\n        E4[\"Strategist Agent\"]\n    end\n\n    F[\"Phase 6: Streamlit Dashboard\"]\n\n    A1 --> B1\n    A1 --> B2\n    A2 --> C1\n    A3 --> D1 --> D2\n    B1 --> E1\n    B2 --> E1\n    C1 --> E2\n    D2 --> E3\n    E1 --> E4\n    E2 --> E4\n    E3 --> E4\n    E1 --> F\n    E2 --> F\n    E3 --> F\n    E4 --> F\n```\n\n---\n\n## The four agents\n\n**Quant Agent** ([`agents/quant_agent.py`](agents/quant_agent.py)) forecasts next-day price direction with a PyTorch GRU (`models/forecaster_rnn.py`) and computes real portfolio metrics (annualized return/volatility/Sharpe) from historical price data. Its sharpest finding is also its most important caveat, and it's surfaced prominently rather than buried: on the Phase 1 validation holdout, a naive persistence baseline (\"today repeats yesterday\") beat *both* trained models — 51.03% vs. the GRU's 49.07% (final-epoch checkpoint) / 49.02% (best-val-loss checkpoint) vs. the from-scratch NumPy net's 47.11%. Every forecast this agent reports is paired with that context, not presented as more reliable than it is.\n\n**Sentiment Agent** ([`agents/sentiment_agent.py`](agents/sentiment_agent.py)) scores real GDELT news headlines with a DistilBERT model fine-tuned on Financial PhraseBank (`models/sentiment_finetune.py`), restricted to headlines where the ticker's company name is confirmed present among spaCy-extracted entities (`nlp/ner_extraction.py`) — a relevance filter that matters concretely: for TATAPOWER.NS, the bare alias \"Tata\" appears in the entity data for 10 headlines that are actually about Tata Motors, Tata Steel, or Tata Group generally (vs. 41 headlines genuinely about Tata Power), so the agent deliberately excludes that alias rather than let it dilute the sample. Tickers with thin relevance-confirmed coverage (below 50 headlines) get an explicit low-confidence warning instead of a percentage presented as if it were robust.\n\n**Compliance Agent** ([`agents/compliance_agent.py`](agents/compliance_agent.py)) answers regulatory questions grounded in 10 real SEBI circulars via a LangChain RAG chain (`chains/langchain_pipelines.py`) over a Chroma vector store. Every answer is either cited with `[Source: <slug>]` or explicitly declines for insufficient grounding — confirmed on a genuinely out-of-corpus question (cryptocurrency regulation, which none of the 10 circulars address) declining correctly rather than hallucinating an answer. Getting here required two real, non-obvious findings: query phrasing changes retrieval quality (see [Findings & Lessons](#findings--lessons)), and topic *breadth* — not just retrieval quality — determines whether the grounding check accepts or declines an answer.\n\n**Strategist Agent** ([`agents/strategist_agent.py`](agents/strategist_agent.py)) has no tools of its own; it synthesizes the other three agents' outputs into a structured six-section recommendation (Recommendation → Quant Summary → Sentiment Summary → Compliance Summary → Points of Tension → Confidence & Caveats) via CrewAI's `Task.context` chaining. It's instructed never to average or silently pick between conflicting signals — a real run shows this working: it explicitly weighted a grounded Compliance finding over a Quant signal it called \"effectively noise,\" rather than blending the two into false consensus.\n\n---\n\n## Example query + real output\n\n**Ticker:** `RELIANCE.NS`\n**Question:** *\"Should I be concerned about RELIANCE.NS's exposure given recent regulatory and market developments?\"*\n\nThis is the actual Strategist output from a real, verified end-to-end run (all four agents, zero fabricated content) — full agent-by-agent trace, including CrewAI's verbose execution log, is in [`agents/sample_run_output.txt`](agents/sample_run_output.txt).\n\n> ## Recommendation\n> Monitor RELIANCE.NS, as the weak quantitative signal is offset by a positive regulatory development regarding Minimum Public Shareholding compliance, while sentiment remains mixed.\n>\n> ## Quant Summary\n> The GRU model forecasts an \"UP\" direction with a probability of 0.518. However, a critical caveat states that Phase 1 validation results showed a persistence baseline (51.03% accuracy) outperformed both the from-scratch NumPy NN (47.11%) and the GRU (final-epoch checkpoint: 49.07%, best-val-loss checkpoint: 49.02%). Neither trained model beat the naive baseline, indicating the forecast should be treated as a weak signal. Historical portfolio metrics (2021-07-01 to 2026-06-30) show an annualized return of 8.90%, annualized volatility of 22.32%, and a Sharpe ratio of 0.399 (assuming a 0% risk-free rate).\n>\n> ## Sentiment Summary\n> Based on 127 relevance-confirmed headlines, sentiment for RELIANCE.NS is predominantly neutral (55.9%), with a notable positive component (29.9%) and a smaller negative component (14.2%).\n>\n> ## Compliance Summary\n> SEBI has granted a \"Relaxation from the applicability of SEBI Master Circular for compliance with the provisions of the SEBI (Listing Obligations and Disclosure Requirements) Regulations, 2015 on non-compliance with the Minimum Public Shareholding (MPS) requirements\" [Source: lodr-relaxation-2026, chunk 0]. This relaxation specifically addresses the SEBI Master Circular dated July 11, 2023, concerning compliance procedures for listed entities.\n>\n> ## Points of Tension\n> There is significant tension between the quantitative signal and the compliance finding. The Quant Agent's forecast of \"UP\" (P(up)=0.518) is explicitly documented as a weak and unreliable signal, as its underlying model failed to beat a naive persistence baseline during validation. Conversely, the Compliance Agent provides a clear, grounded finding of a regulatory relaxation granted by SEBI regarding Minimum Public Shareholding compliance, which is a positive development for the company. Sentiment is mixed, leaning neutral, and does not provide a strong directional signal. I am weighting the Compliance Agent's grounded finding more heavily than the unreliable Quant signal, as the compliance information represents a concrete reduction in a specific regulatory risk, whereas the quant forecast is effectively noise.\n>\n> ## Confidence & Caveats\n> Data recency: quant/sentiment data reflects historical data through 2026-06-30, not live markets; compliance corpus covers general SEBI regulations, not company-specific filings. This is a demo analysis, not investment advice.\n\n---\n\n## Setup\n\n> **Already set up before?** Relaunch anytime with:\n> ```bash\n> ./.venv/Scripts/python.exe -m streamlit run app/dashboard.py\n> ```\n> then open `http://localhost:8501` in a browser. This only works if `data/raw/`, `data/processed/`, and `models/checkpoints/` haven't been deleted — otherwise re-run the full pipeline first, per the steps below.\n\n> **Read this before running anything, first time.** `data/raw/`, `data/processed/`, and `models/checkpoints/` are all gitignored — regenerable artifacts, not committed source. A fresh clone of this repo **cannot** run the dashboard or the crew with just `pip install -r requirements.txt && streamlit run app/dashboard.py` — every pipeline script below has to be re-run first, in order, with real API keys. Fine-tuning alone (`models/sentiment_finetune.py`) took roughly 40 minutes on the original run. If you're evaluating this project and can't spare that time, the [example output above](#example-query--real-output) and the [demo video](#demo) are the fastest way to see it working.\n\n1. **Environment**\n   ```bash\n   python -m venv .venv\n   source .venv/bin/activate  # or .venv\\Scripts\\activate on Windows\n   pip install -r requirements.txt\n   python -m spacy download en_core_web_sm\n   ```\n2. **API keys** — copy `.env.example` to `.env` and fill in real values: `GOOGLE_API_KEY` (Gemini, free tier — see [rate limits](#known-limitations) below), `HUGGINGFACE_TOKEN`, `NEWSAPI_KEY`.\n3. **Regenerate data + models, in order:**\n   ```bash\n   python data/ingest_prices.py          # yfinance OHLCV, 8 NSE tickers\n   python data/ingest_news.py            # GDELT headlines\n   python data/ingest_filings.py         # downloads 10 real SEBI circulars from sebi.gov.in\n   python nlp/preprocess.py\n   python nlp/ner_extraction.py\n   python nlp/embeddings_baseline.py\n   python models/forecaster_nn.py        # from-scratch NumPy NN + pooled_features.csv\n   python models/forecaster_rnn.py       # PyTorch GRU, saves checkpoints\n   python models/optimizer_comparison.py # optional -- plot already committed\n   python models/sentiment_finetune.py   # fine-tunes DistilBERT, ~40 min\n   python rag/chunking.py\n   python rag/vector_store.py            # builds the Chroma vector store\n   ```\n4. **Run the dashboard:**\n   ```bash\n   streamlit run app/dashboard.py\n   ```\n   Or run the crew directly from the command line:\n   ```bash\n   python agents/crew.py\n   ```\n\n---\n\n## Phase 6 status (honest, not rounded up)\n\nThe dashboard is fully built and verified end-to-end in a real browser:\n\n- ✅ Page renders cleanly, no errors.\n- ✅ Ticker dropdown lists all 8 tickers with correct company-name labels, sourced from `data/ingest_prices.py`'s `TICKERS` — no free text, so a zero-data ticker isn't reachable.\n- ✅ Portfolio chart + metrics render immediately on ticker selection (zero API calls), and the numbers match `agents/quant_agent.py`'s own computation exactly, since the dashboard reuses that same function.\n- ✅ Live per-agent progress panel — the loading state required by the brief — proven working through all 4 agents in a real run (Quant → Sentiment → Compliance → Strategist, each completing with live status updates).\n- ✅ The Strategist's final answer renders live in the chat bubble *through the dashboard specifically*, with the full six-section structure and the Agent Reasoning Trace panel showing all three upstream agents' raw output. Confirmed on a fresh, clean run — see the [demo](#demo) below.\n\nOne real bug surfaced during this final round of testing, found and fixed before the confirming run: `agents/sentiment_agent.py`'s NER relevance filter crashed on tickers whose extracted entity data happened to contain the literal string `\"NA\"` (pandas' default null inference silently turned that valid string into a `float` `NaN`) — root cause and fix in commit `788d2f1`. All 8 tickers, including the two affected (`SUNPHARMA.NS`, `MARUTI.NS`), are confirmed working with zero regression on the rest.\n\n---\n\n## Findings & Lessons\n\nReal findings from across all six phases, each grounded in code that's actually in this repo — not summarized from memory.\n\n**Persistence beats both trained models** (Phase 1). On the 2025-07 to 2026-06 validation holdout, a naive \"today repeats yesterday\" baseline scored 51.03% accuracy — beating the from-scratch NumPy NN (47.11%) and the PyTorch GRU (49.07% final-epoch, 49.02% best-val-loss checkpoint). An honest negative result, surfaced in every Quant Agent output rather than hidden. See `agents/quant_agent.py`'s `PHASE1_RESULTS` constant.\n\n**TF-IDF baseline refit, not reused, for the sentiment comparison** (Phase 3). This is a methodological design decision, not an empirical \"TF-IDF failed\" result — worth stating precisely rather than rounding it up. `models/sentiment_finetune.py` fits its TF-IDF+LogisticRegression baseline fresh on Financial PhraseBank's own vocabulary rather than reusing Phase 2's vectorizer (which was fitted on GDELT headline vocabulary): the two corpora's vocabularies differ enough that reusing the GDELT-fitted vectorizer would have biased the comparison against the baseline through vocabulary mismatch, not genuine methodological weakness. No accuracy numbers are checked into the repo for this comparison — the applied comparison (both models scoring the same real GDELT headlines) has no ground-truth labels, so it's a qualitative agreement/disagreement comparison, not an accuracy metric.\n\n**Tata Power alias disambiguation** (Phase 2 data, applied in Phase 5). `agents/sentiment_agent.py`'s `TICKER_ALIASES` deliberately excludes the bare alias `\"tata\"` for `TATAPOWER.NS`. The reason is a real count, not a guess: in `data/processed/news/ner_entities.csv`, the bare entity text \"Tata\" appears in 10 headlines, and \"Tata Motors\" in 9, \"Tata Steel\" in 4, and \"Tata Group\" in 4 more — none of them about Tata Power — versus 41 headlines genuinely mentioning \"Tata Power\" by name. Filtering on the bare alias would have pulled 27+ irrelevant headlines into TATAPOWER.NS's sentiment sample.\n\n**Negative-query grounding decline** (Phase 4). Asked a genuinely out-of-corpus question (SEBI's position on cryptocurrency regulation — none of the 10 circulars address it), `chains/langchain_pipelines.py`'s RAG chain declines with an exact, checkable sentence rather than hallucinating an answer. The decline isn't a vague refusal — it's a structurally verifiable string (`DECLINE_PHRASE`) that a downstream caller can check for programmatically.\n\n**Nucleus-sampling hallucination** (Phase 3). Comparing greedy, beam search, and nucleus sampling (`top_p=0.9`) for summarizing a real SEBI circular (`rag/decoding_comparison.py`), nucleus sampling produced a fluent but factually wrong summary: it wrote **\"SBI\"** (State Bank of India — a real but different entity) in place of **\"SEBI\"**, and garbled \"SEBI\" a second time into **\"SEBS\"**. Beam search correctly surfaced the circular's actual content; greedy search locked onto a low-information procedural sentence. This is exactly the entity-hallucination risk that matters for a Compliance Agent, which is why every production chain in this project uses `temperature=0`, no nucleus sampling.\n\n**Query phrasing changes retrieval quality** (Phase 4). A terse keyword query (\"Minimum Public Shareholding relaxation\") retrieved the *wrong* circular entirely; the identical intent phrased as a natural question (\"What relaxation has SEBI granted for Minimum Public Shareholding (MPS) compliance?\") correctly surfaced the right chunks. `all-MiniLM-L6-v2` is trained on sentence-length text, not keyword phrases — a real, confirmed characteristic of the embedding model, enforced in code (`rag/retriever.py`'s docstring, and `agents/compliance_agent.py`'s `_ensure_natural_question()` guard) rather than left to convention. A related, smaller finding from the same debugging: chunks dominated by page-header boilerplate embedded measurably worse than the same content without it — 0.48 vs. 0.36 cosine similarity, a ~25% relative drop.\n\n**Query narrowness, not just phrasing, affects grounding** (Phase 5). A broader, compound question (\"what obligations *or* relaxations apply...\") got declined by the strict grounding prompt even when it retrieved the exact correct chunk with a *better* similarity score than a working query — because a narrowly-scoped circular genuinely can't fully answer a broad compound question, and the strict \"answer only from context\" instruction correctly refuses to overreach. Fixed by narrowing `agents/compliance_agent.py`'s question template to ask one specific thing, not by loosening the grounding check.\n\n**Two client libraries, one shared quota** (Phase 5). `crewai.LLM` and `langchain_google_genai.ChatGoogleGenerativeAI` are structurally different client objects that both draw against the *same* Gemini API quota. A rate limiter scoped to only one of them is blind to calls made through the other — this caused two live end-to-end crew failures before being properly diagnosed. Fixed with `agents/rate_limiter.py`: a single shared, process-wide minimum-interval choke point (13s, derived directly from a confirmed `429` error's `\"limit: 5, model: gemini-2.5-flash\"` message) that both client libraries consult, plus `result_as_answer=True` on all three tools to cut the total call count in the first place.\n\n---\n\n## Repo structure\n\n```\nalphaagent/\n├── data/               # ingestion scripts (Phase 1-2) -- outputs gitignored\n├── models/             # from-scratch NN, GRU, optimizer comparison, sentiment fine-tune (Phase 1, 3)\n├── nlp/                # regex cleaning, spaCy NER, TF-IDF baseline (Phase 2)\n├── rag/                # chunking, Chroma vector store, retriever, decoding comparison (Phase 3-4)\n├── agents/              # 4 CrewAI agents + crew.py orchestration (Phase 5)\n├── chains/              # LangChain grounded RAG chain (Phase 4)\n├── app/                 # Streamlit dashboard (Phase 6)\n├── notebooks/            # Phase 1 exploration + write-up\n├── requirements.txt\n├── .env.example\n├── PROJECT_BRIEF.md      # full phase-by-phase spec this was built against\n└── README.md\n```\n\n---\n\n## Known limitations\n\n- **Historical, not live, data.** All quant/sentiment analysis is computed from data ingested through 2026-06-30 — not real-time market data.\n- **8-ticker basket only.** RELIANCE.NS, TCS.NS, INFY.NS, HDFCBANK.NS, SUNPHARMA.NS, MARUTI.NS, PIIND.NS, TATAPOWER.NS — the tickers this project's data actually covers, enforced by the dashboard's dropdown-only ticker selection.\n- **Gemini free-tier quota.** 20 requests/day and 5 requests/minute per model — a full crew run costs roughly 5 real calls, so expect to hit the daily limit after ~4 runs. See `agents/rate_limiter.py`.\n- **General SEBI regulations, not company-specific filings.** The 10-circular RAG corpus covers market-wide regulation (MPS, LODR, mutual funds, surveillance, etc.), not any single company's filings.\n- **This is a demo, not investment advice** — stated explicitly in every Strategist output's Confidence & Caveats section.\n\n---\n\n## Demo\n\nA full live run: ticker selection → Run Analysis → live per-agent progress → the Strategist's answer rendering in the chat bubble → the Agent Reasoning Trace panel — including `SUNPHARMA.NS`'s sentiment analysis working correctly after the NER `keep_default_na` fix (commit `788d2f1`).\n\n<video src=\"assets/demo.mp4\" controls width=\"720\">\n  Your browser doesn't support inline video playback -- <a href=\"assets/demo.mp4\">download the file directly</a> instead.\n</video>\n\nIf the embedded player above doesn't render for you (some non-GitHub markdown viewers don't support inline `<video>`):\n- **Direct file:** [`assets/demo.mp4`](assets/demo.mp4)\n- **Backup / fallback (Google Drive):** https://drive.google.com/file/d/1XLrvuBaqnB37F_oOAn45nzeqDQtaDikj/view?usp=sharing\n","readmeExcerpt":"AlphaAgent **A multi-agent equity research & portfolio co-pilot.** AlphaAgent mimics a buy-side equity research desk: four specialized AI agents (Quant, Sentiment, Compliance, Strategist) collaborate to turn a question like *\"Should I be concerned about RELIANCE.NS's exposure given recent regulatory and market developments?\"* into a grounded, citation-backed recommendation — with every claim traceable back to a speci","codeSnippets":[],"executableExamples":[{"language":"mermaid","snippet":"flowchart TD\n    subgraph P1[\"Phase 1-2: Ingestion + Forecasting\"]\n        A1[\"ingest_prices.py<br/>yfinance OHLCV, 8 NSE tickers\"]\n        A2[\"ingest_news.py<br/>GDELT headlines\"]\n        A3[\"ingest_filings.py<br/>10 real SEBI circulars\"]\n        B1[\"forecaster_nn.py<br/>NumPy NN, manual backprop\"]\n        B2[\"forecaster_rnn.py<br/>PyTorch GRU\"]\n    end\n\n    subgraph P3[\"Phase 3: Fine-tuning + LLM Layer\"]\n        C1[\"sentiment_finetune.py<br/>fine-tuned DistilBERT\"]\n        C2[\"decoding_comparison.py<br/>greedy / beam / nucleus\"]\n    end\n\n    subgraph P4[\"Phase 4: RAG Layer\"]\n        D1[\"chunking.py + vector_store.py<br/>Chroma + all-MiniLM-L6-v2\"]\n        D2[\"langchain_pipelines.py<br/>grounded chain, Gemini 2.5 Flash\"]\n    end\n\n    subgraph P5[\"Phase 5: CrewAI Agents\"]\n        E1[\"Quant Agent\"]\n        E2[\"Sentiment Agent\"]\n        E3[\"Compliance Agent\"]\n        E4[\"Strategist Agent\"]\n    end\n\n    F[\"Phase 6: Streamlit Dashboard\"]\n\n    A1 --> B1\n    A1 --> B2\n    A2 --> C1\n    A3 --> D1 --> D2\n    B1 --> E1\n    B2 --> E1\n    C1 --> E2\n    D2 --> E3\n    E1 --> E4\n    E2 --> E4\n    E3 --> E4\n    E1 --> F\n    E2 --> F\n    E3 --> F\n    E4 --> F"},{"language":"bash","snippet":"> ./.venv/Scripts/python.exe -m streamlit run app/dashboard.py\n>"},{"language":"bash","snippet":"python -m venv .venv\n   source .venv/bin/activate  # or .venv\\Scripts\\activate on Windows\n   pip install -r requirements.txt\n   python -m spacy download en_core_web_sm"},{"language":"bash","snippet":"python data/ingest_prices.py          # yfinance OHLCV, 8 NSE tickers\n   python data/ingest_news.py            # GDELT headlines\n   python data/ingest_filings.py         # downloads 10 real SEBI circulars from sebi.gov.in\n   python nlp/preprocess.py\n   python nlp/ner_extraction.py\n   python nlp/embeddings_baseline.py\n   python models/forecaster_nn.py        # from-scratch NumPy NN + pooled_features.csv\n   python models/forecaster_rnn.py       # PyTorch GRU, saves checkpoints\n   python models/optimizer_comparison.py # optional -- plot already committed\n   python models/sentiment_finetune.py   # fine-tunes DistilBERT, ~40 min\n   python rag/chunking.py\n   python rag/vector_store.py            # builds the Chroma vector store"},{"language":"bash","snippet":"streamlit run app/dashboard.py"},{"language":"bash","snippet":"python agents/crew.py"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[],"languages":["python"],"docsSourceLabel":"GITHUB REPOS","editorialOverview":"A multi-agent equity research co-pilot : GRU forecasting, fine-tuned sentiment analysis, and citation-grounded RAG over real SEBI regulations, orchestrated by CrewAI agents that reason honestly about their own signal quality. AlphaAgent **A multi-agent equity research & portfolio co-pilot.** AlphaAgent mimics a buy-side equity research desk: four specialized AI agents (Quant, Sentiment, Compliance, Strategist) collaborate to turn a question like *\"Should I be concerned about RELIANCE.NS's exposure given recent regulatory and market developments?\"* into a grounded, citation-backed recommendation — with every claim traceable back to a speci","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":432,"uniquenessScore":64,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T18:04:02.078Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T18:04:02.078Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T05:00:03.793Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/github_repos","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}