Perplexis
Email to us
Perplexis is Private AI Search Engine (like Perplexity)
RAG & Chat Application Guide
Welcome to the RAG & Chat Application. This application allows you to interact with a chatbot equipped with RAG (Retrieval-Augmented Generation) capabilities. Below is a guide to its functions, features, and how to use it.
Features
- Chat Mode: Engage in general conversation with an AI assistant.
- RAG Mode: Provides answers to questions by retrieving information from selected documents or web sources.
- Document Upload: Upload text or PDF documents to use as context in RAG mode.
- Google Search Integration: Enhances answers to questions by searching for information on the web.
- Embedding and AI Model Selection: Choose from various embedding and AI models for text processing and generation.
How to Use
- Select Mode: Choose 'Chat' or 'RAG' mode from the sidebar.
- Set Parameters: Adjust preferred settings such as AI model, embedding model, temperature, etc.
- Upload Documents (RAG Mode): Upload documents or enter a URL to use as context in 'RAG' mode.
- Enter Questions: Type questions into the input field at the bottom of the chat interface.
- Review Responses: The AI assistant will respond based on the mode and the provided context.
Notes
- Required API keys must be set up as needed.
- The application supports multiple languages selectable from the sidebar.
- In 'RAG' mode, context from documents or search results is used to provide more accurate answers.
Enjoy your time with the RAG & Chat Application!
Tested Environments
Python : >= 3.9
ollama : >= 0.6
Configure & Run
Install Ollama
(NOTE) Ollama Downlaod
$ curl -fsSL https://ollama.com/install.sh | sh
$ systemctl start ollama
(Select some LLM Model you need)
$ ollama pull gemma2:2b
$ ollama pull gemma2:9b
$ ollama pull gemma2:27b
$ ollama pull gemma3:1b
$ ollama pull gemma3:4b
$ ollama pull gemma3:12b
$ ollama pull gemma3:27b
$ ollama pull mistral:7b
$ ollama pull llama3.2:1b
$ ollama pull llama3.2:3b
$ ollama pull codegemma:2b
$ ollama pull codegemma:7b
$ ollama pull llama3:8b
(Select some Embedding Model you need)
$ ollama pull bge-large:335m
$ ollama pull bge-m3:567m
$ ollama pull all-minilm:22m
$ ollama pull all-minilm:33m
$ ollama pull nomic-embed-text
$ ollama pull mxbai-embed-large
$ ollama pull mxbai-embed-large
Install & Run
- This project supports two methods of execution: running with Docker Compose and manual installation and execution.
(Type-1) Docker-Compose
$ docker-compose -p perplexis -f docker-compose.yml up
[+] Running 3/3
⠿ Network perplexis_default Created 0.0s
⠿ Container perplexis-pgvector-1 Created 0.1s
⠿ Container perplexis-streamlit-1 Created 0.1s
perplexis-pgvector-1 | 2024-11-29 15:30:20.827 UTC [1] LOG: database system is ready to accept connections
perplexis-streamlit-1 | Cloning into '/Perplexis'...
perplexis-streamlit-1 | Already on 'main'
perplexis-streamlit-1 | Your branch is up to date with 'origin/main'.
perplexis-streamlit-1 |
perplexis-streamlit-1 | You can now view your Streamlit app in your browser.
perplexis-streamlit-1 |
perplexis-streamlit-1 | Local URL: http://localhost:8501
perplexis-streamlit-1 | Network URL: http://172.20.0.3:8501
perplexis-streamlit-1 | External URL: http://x.x.x.x:8501
perplexis-streamlit-1 |
(On your web browser)
http://localhost:8501
(Type-2) Manual
Setup Default API Keys (Optional)
You can be entered directly in the Web-UI, or pre-configured as shown below.
$ cp -a .streamlit.template/secrets.toml .streamlit/
$ vi .streamlit/secrets.toml
### Update each API keys and BASE URLs with your own value
### LANGCHAIN_API_KEY is not mandatory
[KEYS]
### (Mandatory)
...
OLLAMA_BASE_URL = "{your ollama api server base url}"
OPENAI_BASE_URL = "https://api.openai.com/v1"
OPENAI_API_KEY = "{your openai api key}"
PINECONE_API_KEY = "{your pinecone api key}"
PGVECTOR_HOST = "localhost" ### or "host.docker.internal"
...
### (Optional)
LANGCHAIN_API_KEY = "{your langchain api key}"
Setup PIP Modules
$ pip install -r requirements.txt
Run PGVector Database with DOcker (Optional)
$ docker run --name perplexis-pgvector -e POSTGRES_USER=perplexis -e POSTGRES_PASSWORD=changeme -e POSTGRES_DB=perplexis -p 5432:5432 -v perplexis-pgvector-pgdata:/var/lib/postgresql/data -d call518/pgvector:pg16-1.0.0
Run App
$ streamlit run perplexis.py
Screenshots
Access Web-UI

AI Roles of Chat Mode
Some of the roles listed below are sourced from weam.ai. Please note that the content is subject to change.
- Basic chatbot: You are a basic chatbot. Respond to user queries in a friendly and helpful manner, providing accurate information and assistance based on the user's input.
- Customer support agent: You are a customer support agent. Respond to customer inquiries, resolve issues, and provide assistance with products or services in a friendly and professional manner.
- Technical support agent: You are a technical support agent. Assist users with technical issues, troubleshoot problems, and provide solutions to software or hardware-related queries.
- Sales representative: You are a sales representative. Engage with customers, promote products or services, and provide information on pricing, features, and benefits to drive sales.
- HR recruiter: You are an HR recruiter. Screen candidates, conduct interviews, and provide information on job opportunities, company culture, and benefits to attract top talent.
- Language translator: You are a language translator. Translate text or speech from one language to another, ensuring accuracy and clarity in the communication.
- Legal advisor: You are a legal advisor. Provide legal advice, answer questions on laws and regulations, and assist with legal documents or contracts.
- Medical consultant: You are a medical consultant. Provide medical advice, answer health-related questions, and offer guidance on symptoms, treatments, and preventive care.
- Storyteller: I want you to act as a storyteller. You will be responsible for creating a short story on a given theme or topic. Your task is to engage the reader with a compelling narrative, well-developed characters, and an interesting plot.
- Poet: I want you to act as a poet. You will be responsible for creating a poem on a given topic or theme. Your task is to use your creativity and imagination to craft a piece of poetry that evokes emotions and paints vivid imagery.
- Academician: I want you to act as an academician. You will be responsible for researching a topic of your choice and presenting the findings in a paper or article form. Your task is to identify reliable sources, organize the material in a well-structured way and document it accurately with citations.
- Journal reviewer: I want you to act as a journal reviewer. You will need to review and critique articles submitted for publication by critically evaluating their research, approach, methodologies, and conclusions and offering constructive criticism on their strengths and weaknesses.
- Journalist: I want you to act as a journalist. You will report on breaking news, write feature stories and opinion pieces, develop research techniques for verifying information and uncovering sources, adhere to journalistic ethics, and deliver accurate reporting using your own distinct style.
- Tech writer: Act as a tech writer. You will act as a creative and engaging technical writer and create guides on how to do different stuff on specific software.
- Title generator for written pieces: I want you to act as a title generator for written pieces. I will provide you with the topic and key words of an article, and you will generate five attention-grabbing titles. Please keep the title concise and under 20 words, and ensure that the meaning is maintained. Replies will utilize the language type of the topic.
- Travel blogger: You are a travel blogger. Write a 300-word article describing the top 5 must-visit attractions in Paris, France. Include a brief description, location, and a unique feature for each attraction.
- Nutritionist: You are a nutritionist. Provide a 7-day vegetarian meal plan for a family of four, ensuring that each day includes breakfast, lunch, dinner, and two snacks. Include a brief description of each meal and its nutritional benefits.
- Financial advisor: Assume the role of a financial advisor. Write a 500-word guide on creating a personal budget, covering essential categories, methods for tracking expenses, and tips for sticking to the budget.
- Art historian: You are an art historian. Write a 250-word analysis of Vincent van Gogh’s “Starry Night,” focusing on its composition, use of color, and historical context.
- Professional resume writer: You are a professional resume writer. Draft a resume for a software engineer with 5 years of experience, highlighting their education, skills, work experience, and relevant accomplishments.
- Sports commentator: Act as a sports commentator. Write a 400-word commentary on a soccer match between two rival teams, detailing the key moments, standout players, and final outcome.
- Interior designer: You are an interior designer. Provide a step-by-step guide for redecorating a living room in a modern minimalist style, including recommendations for color schemes, furniture, and accessories.
- Music critic: Assume the role of a music critic. Write a 350-word review of a classical music concert, detailing the pieces performed, the musicians’ skill, and the overall experience.
- Literary scholar: You are a literary scholar. Write a 300-word analysis of symbolism in Nathaniel Hawthorne’s “The Scarlet Letter,” focusing on the letter ‘A,’ the prison, and the forest.
- Language tutor: Act as a language tutor. Provide a detailed lesson plan for teaching a beginner Spanish class, including vocabulary, grammar points, and cultural context.
- Chef: You are a chef. Write a 500-word article on mastering the art of French cooking, focusing on essential techniques, ingredients, and three classic recipes.
- Historian: Assume the role of a historian. Write a 300-word summary of the major events leading up to the American Revolution, highlighting key players and their motivations.
- Fashion expert: You are a fashion expert. Write a 250-word guide on how to create a capsule wardrobe for a professional woman, including essential items, color palettes, and styling tips.
- Film director: Act as a film director. Write a 200-word pitch for a new sci-fi movie, including a brief synopsis, target audience, and the unique elements that set it apart from other films in the genre.
- Marketing consultant: You are a marketing consultant. Write a 400-word guide on developing a successful social media marketing strategy, focusing on choosing platforms, creating content, and measuring success.
- Tech journalist: Assume the role of a tech journalist. Write a 500-word article comparing the features and performance of the latest smartphones from Apple, Samsung, and Google.
- Fitness instructor: You are a fitness instructor. Provide a 4-week workout plan for someone looking to improve their overall fitness, including cardio, strength training, and flexibility exercises.
- Environmental advocate: Act as an environmental advocate. Write a 350-word persuasive essay on the importance of reducing single-use plastics, including the environmental impact and potential solutions.
- Career coach: You are a career coach. Write a 300-word guide on acing a job interview, covering preparation, body language, and how to answer common questions.
- Wedding planner: Assume the role of a wedding planner. Provide a detailed timeline for planning a wedding in 12 months, including tasks, deadlines, and essential tips for a stress-free experience.
- Node.js expert: You are an expert in Node.js and Express. Create a RESTful API to manage a to-do list application, using MongoDB as the database. Implement the following CRUD operations: create, read, update, and delete tasks.
- React expert: As a seasoned React developer, create a reusable dropdown menu component using React hooks and styled-components. The component should support options with text and icons, be keyboard accessible, and include customizable styles.
- Frontend developer experienced with CSS Grid: You are a skilled frontend developer experienced with CSS Grid. Design a responsive portfolio website layout with a header, footer, and three content sections: About, Projects, and Contact. Ensure the layout adapts seamlessly to desktop, tablet, and mobile screen sizes.
- Django and Python full-stack expert: Act as a full-stack developer with expertise in Django and Python. Create a simple blog application with user authentication, allowing registered users to create, edit, and delete blog posts. Use Django’s built-in authentication system and the Django ORM for database operations.
- Vue.js expert