conversational-agent-langchain  by mfmezger

FastAPI backend for conversational RAG agents

Created 3 years ago
251 stars

Top 99.8% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a FastAPI-based REST backend for a conversational Retrieval-Augmented Generation (RAG) agent. It targets developers seeking to integrate document embedding, semantic search, and question-answering capabilities into their applications, leveraging flexible LLM providers and robust vector storage for enhanced accuracy and context-awareness.

How It Works

The system orchestrates a RAG pipeline using Langchain and Langgraph, powered by a FastAPI backend. It integrates with various LLM providers (Cohere, OpenAI, Google AI Studio, Ollama) via the LiteLLM abstraction layer, enabling flexible model selection. Documents are embedded and stored in Qdrant, supporting both semantic and hybrid search (semantic + BM25). User queries trigger retrieval of relevant documents, which are then used as context by the LLM to generate responses, reducing hallucinations and enabling QA over private data.

Quick Start & Requirements

  • Primary install/run command: Clone the repository, create a .env file from template.env and populate necessary API keys, then run docker compose up -d.
  • Non-default prerequisites: Docker, API keys for LLM providers (e.g., GEMINI_API_KEY, COHERE_API_KEY).
  • Links:
    • Repository: https://github.com/mfmezger/conversational-agent-langchain.git
    • API Documentation: http://127.0.0.1:8001/docs
    • Frontend: http://localhost:8501
    • Qdrant Dashboard: http://localhost:6333/dashboard
    • Phoenix Dashboard: http://localhost:6006

Highlighted Details

  • LiteLLM Integration: Supports numerous LLM providers through a unified interface.
  • Reranking: Optional document reranking via Cohere or FlashRank to improve retrieval relevance.
  • Hybrid Search: Combines semantic search with BM25 for potentially more comprehensive results.
  • Observability: Integrated Phoenix Tracing for monitoring and debugging the RAG pipeline.
  • FastAPI Backend: Provides a RESTful API for easy integration.
  • Code Quality: Utilizes Rust-native git hooks (prek) for automated checks.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), sponsorships, or roadmap were found in the provided text.

Licensing & Compatibility

The license type is not explicitly stated in the provided README snippet, which is a significant omission for due diligence. Compatibility for commercial use or closed-source linking cannot be determined without a specified license.

Limitations & Caveats

The EmbeddingManagement class contains placeholders for Google and OpenAI embedding providers, suggesting these may require manual implementation. Essential functionality relies on obtaining and configuring multiple API keys. The absence of explicit licensing information presents a potential adoption blocker.

Health Check
Last Commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
6
Issues (30d)
0
Star History
3 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.