Project Detail

Portfolio Agent (Local AI Assistant)

Portfolio Agent is a local-first AI assistant designed to run entirely on the user's machine, ensuring privacy and control over data. It provides a ChatGPT-like experience with advanced capabilities such as streaming responses, multi-thread conversations, long-term memory, and tool integration using LangGraph. The system dynamically switches between local Ollama models and adapts to online/offline modes.

Portfolio Agent (Local AI Assistant)

features

Streaming Responses Real-time assistant replies using Server-Sent Events (SSE).
Thread Management Create, switch, rename, and delete conversation threads.
Long-Term Memory Store and retrieve persistent contextual knowledge.
Local-First Design All data remains on the user's machine by default.
Dynamic Model Switching Switch between installed Ollama models at runtime.
Tool Calling System Integration with tools like email, search, and utilities via LangGraph.
Image Support Upload images for vision-enabled prompts.
Online/Offline Adaptation Automatically adjusts behavior based on connectivity.

applications

Personal AI Assistant A private, customizable alternative to cloud-based AI systems.
Developer Playground Experiment with LangGraph, tool-calling, and LLM orchestration.
Productivity Tool Manage tasks, emails, and knowledge using integrated tools.
Learning Platform Understand how agentic AI systems work in real-world scenarios.

system architecture

Frontend (Presentation Layer) HTML, CSS, and JavaScript interface handling chat UI, threads, and SSE streaming.
Backend (Application Layer) FastAPI server managing APIs, sessions, threads, and LangGraph orchestration.
AI Orchestration Layer LangGraph workflows controlling reasoning, tool usage, and response generation.
LLM Layer Ollama-based local models for inference and generation.
Data Layer SQLite database for threads/messages and JSON files for memory persistence.

current limitations

Single-user architecture (no multi-user support).
Limited scalability for production environments.
Tool functionality depends on external API configurations.
Performance tied to local machine resources and model size.

future enhancements

Multi-user authentication and session isolation.
Cloud sync or hybrid local-cloud mode.
Improved UI/UX with modern frontend frameworks.
Plugin system for adding custom tools easily.
Advanced memory retrieval (vector database integration).
Mobile-friendly interface or standalone desktop app.

Technologies Used

Backend FastAPI, Flask (legacy module), Python
AI Frameworks LangChain, LangGraph
LLM Runtime Ollama
Frontend HTML, CSS, JavaScript
Database SQLite
Streaming Server-Sent Events (SSE)