Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Agentic AI Prototype

License: MIT Python 3.11+ React 18 FastAPI OpenAI Pinecone Deployed on Railway Deployed on Vercel

πŸš€ Live Demo: Frontend | Backend API | API Docs


🎯 Overview

This project is a fully functional Agentic AI system that combines:

Component Description
πŸ€– Agentic AI Autonomous decision-making and workflow execution
πŸ” RAG Retrieval-Augmented Generation for contextual document retrieval
🧠 MCP Model Context Protocol Servers for persistent agent memory
⚑ OpenAI Function/Tool calling for real-world actions
🎨 UI Modern React + TypeScript interface for agent interaction

Live Links:


πŸ§ͺ How to Use β€” Sample Questions

Once you open the frontend, you can ask the AI agent these questions to test its capabilities:

πŸ” Test RAG (Retrieval-Augmented Generation)

The AI has been pre-loaded with sample documents about:

  • Agentic AI
  • RAG
  • MCP
  • Urban Resilience
  • Digital Twins

Ask:

Question Expected Response
What is Agentic AI? The AI will retrieve the document about Agentic AI and answer based on it.
What is RAG? The AI will retrieve the RAG document and explain it.
What is MCP? The AI will retrieve the MCP document and explain it.
What is urban resilience? The AI will retrieve the urban resilience document.
What are digital twins? The AI will retrieve the digital twins document.

🧠 Test MCP Memory

You can store and retrieve information in the agent's persistent memory:

Question Expected Behavior
Save to memory: my_favorite_color = blue The AI will save my_favorite_color = blue to its memory.
What is my favorite color? The AI will retrieve blue from memory and respond.
Save to memory: user_name = Muhammad The AI will store your name.
What is my name? The AI will recall your name.

⚑ Test OpenAI Function/Tool Calling

The AI can perform real-world actions:

Question Expected Behavior
Search the web for Python programming The AI will call the search_web tool and show simulated results.
Analyze this data: {"sales": 1000, "profit": 200} The AI will call the analyze_data tool.
Send an email to test@example.com with subject "Hello" and body "This is a test" The AI will call the send_email tool (simulated).

πŸ€– Test Agentic Workflow

You can run a multi-step autonomous workflow:

Question Expected Behavior
Run workflow for task: plan a project The AI will execute a predefined workflow (analyze β†’ decide β†’ execute).

πŸ–₯️ Screenshots

  • Chat Interface: Chat Interface
  • Agent Dashboard: Agent Dashboard
  • Monitoring Panel: Monitoring Panel

πŸ› οΈ Tech Stack

Backend

Technology Purpose
Python 3.11+ Core language
FastAPI REST API framework
OpenAI API LLM and function calling
Pinecone Vector database for RAG
Uvicorn ASGI server

Frontend

Technology Purpose
React 18 UI framework
TypeScript Type safety
Tailwind CSS Styling
Vite Build tool
Axios HTTP client
LocalStorage Chat history persistence

Infrastructure

Technology Purpose
Docker Containerization
Railway Backend deployment
Vercel Frontend deployment

πŸ“ Project Structure

agentic-ai-prototype/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app.py              # FastAPI server
β”‚   β”œβ”€β”€ requirements.txt    # Python dependencies
β”‚   β”œβ”€β”€ .env.example        # Environment variables
β”‚   β”œβ”€β”€ upload_documents.py # Pinecone upload script
β”‚   └── Dockerfile          # Backend container
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”‚   β”œβ”€β”€ api/            # API client
β”‚   β”‚   β”œβ”€β”€ App.jsx         # Main app
β”‚   β”‚   └── main.jsx        # Entry point
β”‚   β”œβ”€β”€ package.json        # Node dependencies
β”‚   β”œβ”€β”€ vite.config.js      # Vite config
β”‚   └── Dockerfile          # Frontend container
β”œβ”€β”€ docker-compose.yml      # Multi-container setup
└── README.md               # This file

πŸš€ Quick Start (Local Development)

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • OpenAI API Key
  • (Optional) Pinecone API Key for real RAG

1. Clone the Repository

git clone https://github.com/muhammadshiraz/agentic-ai-prototype.git
cd agentic-ai-prototype

2. Backend Setup

cd backend
python -m venv venv311
source venv311/bin/activate  # On Windows: venv311\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY
python app.py

3. Frontend Setup

cd frontend
npm install
npm run dev

4. Open Your Browser


πŸ“‘ API Endpoints

Method Endpoint Description
GET / Health check
POST /api/chat Chat with Agentic AI
POST /api/agent/workflow Run agentic workflow
POST /api/memory/store Store memory
GET /api/memory/retrieve/{key} Retrieve memory
GET /api/memory/list List all memory
DELETE /api/memory/delete/{key} Delete memory

🌐 Deployment

Backend (Railway)

  1. Sign up at Railway.app (free, no credit card required)
  2. Deploy from GitHub repository
  3. Set Root Directory: backend/
  4. Add environment variables:
    • OPENAI_API_KEY
    • PINECONE_API_KEY (optional)
    • PINECONE_ENVIRONMENT (optional)
    • PINECONE_INDEX (optional)

Frontend (Vercel)

  1. Sign up at Vercel.com (free)
  2. Import your GitHub repository
  3. Set Root Directory: frontend/
  4. Framework Preset: Vite
  5. Add environment variable: VITE_API_URL = your Railway backend URL + /api

πŸ“Š Features

  • βœ… Agentic AI β€” Autonomous decision-making and workflow execution
  • βœ… RAG Pipelines β€” Contextual document retrieval for accurate responses
  • βœ… MCP Servers β€” Persistent memory for stateful interactions
  • βœ… OpenAI Function Calling β€” Real-world tool execution
  • βœ… Full Stack β€” Python FastAPI + React TypeScript
  • βœ… Modern Stack β€” Tailwind CSS, Vite, Docker
  • βœ… Production Ready β€” Complete error handling, logging, monitoring
  • βœ… Containerized β€” Docker and Docker Compose support
  • βœ… Chat History Persistence β€” LocalStorage for conversation history
  • βœ… Clear History Button β€” Reset conversation anytime

🚧 Roadmap

  • Add WebSocket support for real-time streaming
  • Add authentication and user sessions
  • Add more tools (Slack, Notion, GitHub, etc.)
  • Add agent memory persistence to database
  • Add CI/CD pipeline with GitHub Actions

🀝 Contributing

Pull requests are welcome. For major changes, please open an issue first.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ”— Connect with Me


⭐ Show Your Support

If you found this project useful, please consider giving it a ⭐ on GitHub!


πŸ“ Acknowledgments


Built with ❀️ by Muhammad Shiraz

About

Agentic AI Prototype with RAG pipelines, MCP Servers, and OpenAI function/tool calling. Built with Python FastAPI backend + React TypeScript frontend.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages