LangConnect is a RAG (Retrieval-Augmented Generation) service built with FastAPI and LangChain. It provides a REST API for managing collections and documents, with PostgreSQL and pgvector for vector storage.
- FastAPI-based REST API
- PostgreSQL with pgvector for document storage and vector embeddings
- Docker support for easy deployment
- Docker and Docker Compose
- Python 3.11 or higher
-
Clone the repository:
git clone https://github.com/langchain-ai/langconnect.git cd langconnect
-
Start the services:
docker-compose up -d
This will:
- Start a PostgreSQL database with pgvector extension
- Build and start the LangConnect API service
-
Access the API:
- API documentation: http://localhost:8080/docs
- Health check: http://localhost:8080/health
To run the services in development mode with live reload:
docker-compose up
The API documentation is available at http://localhost:8080/docs when the service is running.
The following environment variables can be configured in the docker-compose.yml
file:
Variable | Description | Default |
---|---|---|
POSTGRES_HOST | PostgreSQL host | postgres |
POSTGRES_PORT | PostgreSQL port | 5432 |
POSTGRES_USER | PostgreSQL username | postgres |
POSTGRES_PASSWORD | PostgreSQL password | postgres |
POSTGRES_DB | PostgreSQL database name | postgres |
This project is licensed under the terms of the license included in the repository.
List all collections.
Create a new collection.
Get a specific collection by ID.
Delete a specific collection by ID.
List all documents in a specific collection.
Create a new document in a specific collection.
Delete a specific document by ID.
Search for documents using semantic search.