Portfolio Assistant is an advanced AI agent that provides real-time portfolio data acquisition and semantic synthesis. This autonomous system uses Large Language Models (LLMs) to intelligently answer questions about projects, skills, and experience while incorporating custom tool-calling mechanisms for enhanced flexibility.
Key Features:
- 🧠 Intelligent question answering about portfolio content
- 🔄 API key rotation for robust performance
- 📝 Automated logging of user interactions
- 📱 Push notifications for important events
- ⚙️ Custom tool integration for extended functionality
graph TD
A[User] -->|HTTP Request| B[FastAPI]
B --> C[PortfolioAgent]
C --> D{Gemini API}
D -->| Knowledge Retrieval | E[Portfolio Content]
D -->| Tool Calling | F[Record Details]
D -->| Tool Calling | G[Log Questions]
F --> H[Pushbullet]
G --> H
D --> I[Generate Response]
I --> B
B -->|HTTP Response| A
The system architecture consists of:
- FastAPI Server: Handles HTTP requests and CORS
- Portfolio Assistant: Core agent processing logic
- Gemini API: LLM for knowledge retrieval and response generation
- Tool Integration: Custom functions for recording user data
- Notification System: Pushbullet integration for alerts
- Python 3.9+
- FastAPI (Web framework)
- Gemini API (LLM service)
- Pushbullet (Notification service)
- Pydantic (Data validation)
- dotenv (Environment management)
- Python 3.9 or higher
- Gemini API keys (set as environment variables)
- Pushbullet API key (optional for notifications)
- Clone the repository:
git clone https://github.com/yourusername/portfolio-agent.git
cd portfolio-agent- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows- Install dependencies:
pip install -r requirements.txt- Create
.envfile with your credentials:
KNOWLEDGE_URL="https://your-portfolio-content.com"
GEMINI_API_KEY_1="your-gemini-key-1"
GEMINI_API_KEY_2="your-gemini-key-2"
PUSHBULLET_API_KEY="your-pushbullet-key"- Run the application:
uvicorn main:app --reload| Environment Variable | Description | Required |
|---|---|---|
KNOWLEDGE_URL |
URL to portfolio content | Yes |
GEMINI_API_KEY_1 |
Gemini API key 1 | At least one |
GEMINI_API_KEY_2 |
Gemini API key 2 | Optional |
PUSHBULLET_API_KEY |
Pushbullet API key | No |
CHAT_LOG_PATH |
Path to chat logs | No |
Send a message to the portfolio assistant:
Request:
{
"message": "What projects have you worked on?",
"history": [
["Hello", "Hi! How can I help?"]
]
}Response:
{
"response": "I've worked on several projects including..."
}autonomous-portfolio-agent/
├── portfolio_agent/
│ ├── agent.py # Core AI agent logic
│ ├── tools.py # Custom tool-calling functions
│ ├── config.py # Environment configuration
│ ├── logger.py # Structured logging
│ ├── notifier.py # Push notification system
├── main.py # FastAPI server entry point
├── requirements.txt # Python dependencies
├── .env # Environment variables
└── README.md
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.