Skip to content

A state-of-the-art agentic RAG pipeline to answer all your financial queries

sethigeet/FinSight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Setup Instructions

This project requires three servers to be running:

1. Vector Database Server

  1. Create and activate a virtual environment:
python3 -m venv env
source env/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Start the vector database server:
python vector_store.py

2. Main Application Server

  1. Start the main server:
source env/bin/activate
python app.py

3. Logging Server

  1. Create and activate a virtual environment:
cd logging_server
python3 -m venv log_env
source log_env/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Start the logging server:
python server.py
  1. Access the logging dashboard at: http://localhost:7000

Server Ports

  • Vector Database Server: Port 8001
  • Main Application Server: Port 5000
  • Logging Server: Port 7000

Using the Logger in Code

To send logs from your Python code, use the requests library:

import requests
import json

def send_log(message, level="INFO", component=None, question_id=None, track=None):
    log_data = {
        "message": message,
        "level": level,  # "INFO", "WARNING", or "ERROR"
        "component": component,
        "question_id": question_id,
        "track": track
    }
    
    try:
        response = requests.post(
            "http://localhost:7000/log",
            json=log_data
        )
        return response.json()
    except Exception as e:
        print(f"Failed to send log: {str(e)}")

# Examples:

# Basic log
send_log("Processing started")

# Log with component
send_log("Cache miss", component="vector_store")

# Log with question tracking
send_log("Generating answer", question_id="Q123", component="answer_generator")

# Log with track
send_log("Track completed", track="preprocessing", level="INFO")

# Error log
send_log("Database connection failed", level="ERROR", component="db_client")

The logs will be automatically grouped in the dashboard based on:

  1. Question ID (if provided)
  2. Track (if provided)
  3. Component (if provided)
  4. System logs (default)

server_manager.py

server_manager.py handles 1 fast indexing server and 2 slow indexing servers. The script is supposed to be kept running alongside the aforementioned 3 servers.

Configuration Changes

Script has variables related to paths of data directories and cache directories of the 3 servers it manages. It loads values of these variables from config.py. Set the appropriate directory paths for all the servers in config.py for the server manager script to work properly.

Running Instructions

python3 server_manager.py

Preferably run this script in a detached terminal session.

About

A state-of-the-art agentic RAG pipeline to answer all your financial queries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 14