Skip to content

ravi-aratchige/sapphire-intelligence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sapphire Intelligence πŸ’Ž

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.

Project Structure 🌳

.
β”œβ”€β”€ 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

Setup βš™οΈ

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.

About

The brains behind Sapphire πŸ’Ž

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published