Trouble with 1-click-deploy Librechat w/ RAG on Railway
Absolutely baffled how it was easier to deploy a self-hosted librechat on my NAS than it is to do a "1-click-deploy" railway template for Librechat + VectorDB/RAG API for my client.
# What We’re Trying to Achieve
We are building a custom LLM-powered system using retrieval-augmented generation (RAG) to provide business-specific, context-aware responses. The goal is to integrate general domain knowledge with site-specific documentation and dynamic data so that responses are highly relevant and accurate for different operational environments.
## How the System Works:
- **Base LLM**: Utilizes a base LLM equipped with broad industry knowledge.
- **Site-Specific Context**: Injects relevant documents (manuals, engineering data, dynamic SCADA readings, etc.) to provide tailored responses.
- **Structured Input**: Ensures structured input through dropdowns/UI constraints, so the LLM always receives the correct context.
- **Data Combination**: Combines static and dynamic data before feeding it into the model to provide up-to-date, actionable insights.
## Stack and Template:
I have attempted twice to use this Railway template to deploy this LibreChat instance: [Railway Template](https://railway.com/template/b5k2mn)
### System Architecture Components:
1. **Frontend**:
- The user interface powered by LibreChat, providing a chat-based interaction layer.
2. **Retrieval-Augmented Generation (RAG) Backend**:
- A VectorDB serves as the primary storage for embeddings, allowing efficient document retrieval.
- The retrieval process is managed via Danny Avila's RAG API for seamless integration between the frontend and the vector database.
3. **Chat History Persistence**:
- A MongoDB database is utilized to store and manage chat history, ensuring session continuity and query tracking.
4. **Search Indexing**:
- Meilisearch is integrated for fast and flexible search capabilities, optimizing both query performance and document retrieval.
This architecture is designed to provide scalable and efficient context injection for domain-specific responses.
## Current Issues & Roadblocks
1. **Document Retrieval Issues**:
- Uploaded files may not be persisting in storage.
- The retrieval API may not be fetching relevant documents.
2. **Execution Context Problems in Railway-hosted Services**:
- `railway run` appears to execute commands locally instead of within the container.
- `railway shell` doesn’t provide direct service access, complicating debugging.
3. **Database Connectivity Issues**:
- Attempts to connect to the database via PG Admin 4 have failed.
- This suggests potential issues with the Railway database setup, networking, or access credentials.
## What Needs to Happen Next
1. **Document Persistence**: Confirm that uploaded documents persist across redeployments.
2. **Debug Retrieval API**: Investigate whether it is returning the correct context for queries.
3. **Fix Container Execution Issues**: Ensure scripts are running inside the Railway service instead of locally.
4. **Resolve Database Connectivity Problems**: Address issues both from within Railway services and external tools like PG Admin.
The system is well-structured conceptually, but something is preventing retrieval and execution from functioning properly. Need help debugging and resolving these infrastructure issues to get the system up and running as intended.
Any advice?
0
0 comments
Mark Jacobson
1
Trouble with 1-click-deploy Librechat w/ RAG on Railway
AI Automation Society
skool.com/ai-automation-society
A community built to master no-code AI automations. Join to learn, discuss, and build the systems that will shape the future of work.
Leaderboard (30-day)
Powered by