A sophisticated LangGraph-powered AI assistant designed to showcase Robin Rathore's development team and services. This assistant uses LangChain, Google's Gemini model, and a state-based workflow to handle portfolio queries, generate project proposals, and communicate with potential clients.
This project implements an AI portfolio assistant with the following capabilities:
- Share information about team projects and members
- Generate professional project proposals
- Provide details about services offered
- Send emails with project information
- Maintain proper security constraints
- Features
- Prerequisites
- Installation
- Environment Variables
- Project Structure
- Core Components
- Tools
- Workflows
- Security
- Usage Examples
- Contributing
- Project Information: Access details about team projects, including technologies used and team composition
- Team Member Profiles: Get information about individual team members and their skills
- Service Information: Explore the services offered by Robin's development team
- Project Proposals: Generate professional proposals based on client requirements
- Secure Email Communication: Send emails directly to Robin with proper security measures
- State-based Workflow: Advanced LangGraph implementation for controlled conversations
- Node.js (v16.x or higher)
- npm or yarn
- Google Gemini API key
- Gmail account for sending emails
- Clone the repository:
git clone https://github.com/robinrathore/portfolio-assistant.git
cd portfolio-assistant- Install dependencies:
npm install-
Create a
.envfile in the project root (see Environment Variables section) -
Run the application:
npm startCreate a .env file with the following variables:
# Google Gemini API
GOOGLE_API_KEY=your_google_api_key_here
# Email configuration
EMAIL=your_gmail_address
PASSWORD=your_app_specific_password
Note: For Gmail, you'll need to use an App Password instead of your regular password. See Google's documentation for instructions.
The main functionality is implemented in agent.ts, which contains:
- LLM configuration
- Tool definitions
- State annotations
- Graph workflows
- Helper functions
The assistant uses Google's Gemini 1.5 Pro model:
const llm = new ChatGoogleGenerativeAI({
model: "gemini-1.5-pro",
temperature: 0,
maxRetries: 2,
});A custom state annotation for managing portfolio workflows:
const PortfolioStateAnnotation = Annotation.Root({
request: Annotation,
response: Annotation,
status: Annotation,
feedback: Annotation,
projectDetails: Annotation,
});Zod schemas define structured data for:
- Project information
- Email content
- Project proposals
Sends emails with project information to a fixed recipient for security.
Features:
- Restricted to a single recipient (
robinsingh248142@gmail.com) - Prevents duplicate emails in a session
- Supports priority levels
Usage:
await sendEmail({
to: "robinsingh248142@gmail.com",
subject: "Project Proposal",
body: "<h1>Project Proposal</h1><p>Details here...</p>",
priority: "normal"
});Retrieves detailed information about specific projects.
Projects available:
- Website Redesign
- Mobile App
- Data Dashboard
- E-commerce Platform
- CRM System
Usage:
await getProjectInfo({ projectName: "Website Redesign" });Provides information about team members, their skills, and projects.
Team members available:
- Robin (Lead)
- Alex, Jamie, Morgan, Taylor, Casey, Jordan (Team members)
Usage:
await getTeamMemberInfo({ memberName: "Robin" });Creates a tailored project proposal based on client requirements.
Customization options:
- Client name
- Project type
- Requirements
- Budget
- Timeline
Usage:
await generateProjectProposal({
clientName: "TechCorp",
projectType: "Web Application",
requirements: "E-commerce platform with payment processing",
budget: "$10,000-$15,000",
timeline: "3 months"
});Provides a comprehensive introduction to Robin's development team.
Detail levels:
- brief: Basic team information
- detailed: Complete team profile with testimonials
Usage:
await introduceTeam({ detail: "detailed" });Retrieves information about services offered by the team.
Services covered:
- Web Development
- Mobile Development
- UI/UX Design
- Custom Software Development
- E-commerce Solutions
Usage:
await getTeamServices({});The primary workflow manages the conversation flow:
- Process user input with the LLM
- Execute requested tools
- Generate appropriate responses
const portfolioAssistant = new StateGraph(MessagesAnnotation)
.addNode("llmNode", llmNode)
.addNode("toolExecutionNode", toolExecutionNode)
.addEdge("__start__", "llmNode")
.addConditionalEdges(...)
.compile();A specialized workflow for generating high-quality proposals:
- Generate initial proposal
- Review and provide feedback
- Revise if necessary or approve
const proposalWorkflow = new StateGraph(PortfolioStateAnnotation)
.addNode("generateProposal", ...)
.addNode("reviewProposal", ...)
.addConditionalEdges(...)
.compile();The assistant implements several security measures:
- Restricted Email: Can only send to a single hardcoded address
- Topic Constraints: Only discusses Robin's team and services
- Duplicate Prevention: Avoids sending multiple emails for the same request
- Input Validation: Uses Zod schemas to validate all inputs
Several helper functions support proposal generation:
generateApproach: Creates a tailored approach based on project typeallocateTeam: Assigns appropriate team membersgenerateTimeline: Builds a realistic project timelinegenerateBudget: Allocates budget percentages
const response = await runPortfolioAssistant(
"Tell me about your mobile app development services"
);
console.log(response);const response = await runPortfolioAssistant(
"I need a proposal for an e-commerce website with a budget of $15,000"
);
console.log(response);const response = await runPortfolioAssistant(
"Who is on your development team?"
);
console.log(response);- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Commit your changes:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Robin Rathore - robinsingh248142@gmail.com Portfolio: https://robinrathore.dev LinkedIn: https://linkedin.com/in/robinrathore