AI • RAG • AWS • React • Spring Security • Langgraph • MCP

AI Based Portfolio Management

This portfolio project showcases an AI-powered portfolio management application designed to enhance investment decision-making through

  • Continuous news ingestion
  • RAG-based conversational interface
  • Integrated web search
  • Human-in-the-loop validation
A live deployment of the application is available via the link below.

AWS architecture

The platform is deployed on AWS with clear separation across edge routing, API access, application services, data persistence, observability, and management tooling.

AWS architecture diagram

Core services

  • Authorization Service for authentication, validation, and secure access control.
  • Portfolio Service for portfolio-specific APIs and business logic.
  • LangGraph Service for retrieval, document scoring, and reasoning orchestration.
  • News Ingestion for periodic chunking and vector updates from crypto news feeds.
  • MCP Indicator Service for predictive extensions such as price forecasting.
Route 53 CloudFront API Gateway RDS Pinecone

Frontend experience

A modern React-based UI provides a conversational interface, portfolio views, and explainable AI responses tailored for investment workflows.

React Responsive UI Chat Experience

Backend foundation

Python services and Spring Security based authorization separate business capabilities cleanly while enforcing secure access boundaries.

Python Spring Security Service Design

AI decision pipeline

LangGraph drives retrieval, scoring, reasoning, and generation so the system can select the most fitting information before answering.

LangGraph RAG Reasoning Flow

Deployment with Terraform on AWS

Infrastructure is defined as code using Terraform, allowing reproducible environments, controlled changes, and clear separation between application evolution and cloud provisioning.

Infrastructure as code

Terraform provisions edge routing, API components, service infrastructure, database resources, and monitoring primitives in a repeatable way.

Operational governance

CloudTrail, CloudWatch, and Trusted Advisor support compliance visibility, cost awareness, and production health review.

Scalable platform delivery

AWS-native deployment patterns allow the project to evolve from portfolio showcase to production-grade application architecture.

Periodic ingestion and vector freshness

The ingestion service uses the CryptoNews API to fetch the latest market news every 15 minutes. Incoming articles are chunked, enriched with metadata, and written into Pinecone for retrieval by the LangGraph workflow.

Source
Crypto news feed integration via cryptonews-api.com.
Cadence
Polling runs every 15 minutes to keep the knowledge base aligned with current market narratives.
Chunking
Articles are split into retrieval-friendly segments before embedding, improving answer precision and evidence coverage.
Retention
Documents older than 1 week are removed from Pinecone using upload timestamp metadata, reducing stale financial context.
Outcome
The RAG pipeline stays relevant, fast, and focused on fresh market signals rather than outdated sentiment.

LangGraph reasoning flow

The platform uses a retrieval-and-reasoning graph to normalize user requests, gather candidate documents, score relevance, and decide whether generation should continue or fall back to web search.

LangGraph workflow diagram

Graph stages shown here: normalize input, retrieve, grade documents, generate, end, and web search fallback.

Flow summary

  • normalize_input standardizes the prompt and prepares it for retrieval.
  • retrieve fetches candidate documents from the vector database.
  • grade_documents scores relevance and filters weak context.
  • generate produces the answer when support is sufficient.
  • websearch is used when retrieved material is not useful or support is incomplete.
  • end is reached when the answer is considered useful and supported.
Normalize Retrieve Score Generate Fallback Search

Security, validation, error handling, and PROD support

User stories are connected to secure authorization, validation, rate limiting, consistent error contracts, and observability requirements. The goal is not only correctness, but also operability in production.

Quality requirements

  • Spring Security based authorization with resource-level access checks.
  • Clear validation behavior for malformed requests and missing permissions.
  • Rate limiting to protect APIs and AI workloads from abuse.
  • Structured error payloads for support teams, dashboards, and alerting.
  • Trace IDs for cross-service debugging in distributed environments.
  • Monitoring dashboards for PROD support using CloudWatch metrics and logs.
{
  "type": "security",
  "title": "Unauthorized access to a resource",
  "status": 401,
  "detail": "The user: cf5c709c-c68e-405b-852b-19b6f7fc1bc3 has no access to the resource: 1f95abbb-127f-4f0e-85df-681665f9849b",
  "instance": "/api/portfolios/v1/detail/1f95abbb-127f-4f0e-85df-681665f9849b",
  "service": "portfolio service",
  "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "priority": "HIGH",
  "errorCode": "ERR-PORT-021",
  "context": {
    "userId": "cf5c709c-c68e-405b-852b-19b6f7fc1bc3",
    "resource_type": "portfolio",
    "resource_id": "1f95abbb-127f-4f0e-85df-681665f9849b"
  }
}

MCP servers for price predictions

MCP-based services extend the platform beyond retrieval by adding specialized capabilities for indicators, price prediction, and future analytical agents. This makes the assistant layer composable and domain-aware.

  • Dedicated MCP servers can expose prediction and indicator tools to the conversational layer.
  • Predictions can be combined with RAG context, portfolio state, and recent news signals.
  • The design encourages future expansion into technical analysis, risk scoring, and trade idea explanation.