Sapphire Intelligence is the brains behind Sapphire, the digital nomad's guide to Sri Lanka. π±π°
This project was developed to demonstrate the integration of multiple AI-related services to work in harmony and provide reasoning capabilities to software applications.
Sapphire Intelligence features the use of LLMs and chat models for reasoning (context-aware agent with tooling) and content generation (intelligent experience generation for tourists) on LangChain infrastructure, as well as providing Sapphire with support for verifying the biometric data and content of its users' passports.
.
βββ chat # Handles chat-related functionalities
βΒ Β βββ agents.py # Defines various agent classes for chat handling
βΒ Β βββ contextualizers.py # Manages context within chat interactions
βΒ Β βββ __init__.py # Initializes the chat module
βΒ Β βββ payloads.py # Structures for data payloads in chat requests
βΒ Β βββ prompts.py # Contains prompt templates for chat responses
βΒ Β βββ routes.py # Sets up chat-specific API routes
β
βββ database # Contains database configurations
βΒ Β βββ config.py # Database connection and configuration settings
βΒ Β βββ __init__.py # Initializes the database module
β
βββ experience # Handles user experience modules
βΒ Β βββ chains.py # Defines chains of actions or workflows
βΒ Β βββ data_models.py # Defines data models for experience-related entities
βΒ Β βββ __init__.py # Initializes the experience module
βΒ Β βββ output_parsers.py # Parses outputs from experience workflows
βΒ Β βββ payloads.py # Structures for data payloads in experiences
βΒ Β βββ prompts.py # Contains prompt templates for experiences
βΒ Β βββ routes.py # Sets up experience-specific API routes
β
βββ providers # Defines LLM service providers
βΒ Β βββ chat_models.py # Manages chat model integrations
βΒ Β βββ __init__.py # Initializes the providers module
βΒ Β βββ llms.py # Manages LLM integrations
β
βββ schemas # Contains data schema definitions
βΒ Β βββ experiences.py # Schemas for experience-related data
βΒ Β βββ hotels.py # Schemas for hotel-related data
βΒ Β βββ __init__.py # Initializes the schemas module
βΒ Β βββ messages.py # Schemas for message data structures
β
βββ visaguard # Handles visa-related data processing
βΒ Β βββ biometrics.py # Processes biometric data
βΒ Β βββ chains.py # Defines visa-related workflows and chains
βΒ Β βββ data_models.py # Data models specific to visa processing
βΒ Β βββ __init__.py # Initializes the visaguard module
βΒ Β βββ output_parsers.py # Parses outputs from visa workflows
βΒ Β βββ payloads.py # Structures for data payloads in visa workflows
βΒ Β βββ prompts.py # Prompt templates for visa processing
βΒ Β βββ routes.py # Sets up visa-related API routes
β
βββ Dockerfile # Docker configuration for containerizing the app
βββ LICENSE # License information for the project
βββ README.md # Project overview and usage instructions
βββ main.py # Entry point for running the application
βββ requirements.txt # Lists dependencies required to run the application
To setup Sapphire Intelligence, clone this repository to a desired location on your system:
git clone https://github.com/ravi-aratchige/sapphire-intelligence.git
Navigate into the cloned directory:
cd sapphire-intelligence
Create a .env
file within the root folder with the following content:
GROQ_API_KEY = "your-api-key"
COHERE_API_KEY = "your-api-key"
MONGO_URI_STRING = "your-mongo-uri"
To connect to LangSmith for observability, add the following content too:
LANGCHAIN_TRACING_V2=true
LANGCHAIN_ENDPOINT="https://api.smith.langchain.com"
LANGCHAIN_API_KEY="your-api-key"
LANGCHAIN_PROJECT="default"
Install the required packages:
pip install -r requirements.txt
Launch the FastAPI server:
fastapi dev main.py
Built with β€οΈ by Ravindu Aratchige.