ParisNeo commited on
Commit
c07cfa1
·
unverified ·
1 Parent(s): c77d930

Update LightRagWithPostGRESQL.md

Browse files
lightrag/api/docs/LightRagWithPostGRESQL.md CHANGED
@@ -1,3 +1,5 @@
 
 
1
  # Installing and Using PostgreSQL with LightRAG
2
 
3
  This guide provides step-by-step instructions on setting up PostgreSQL for use with LightRAG, a tool designed to enhance large language model (LLM) performance using retrieval-augmented generation techniques.
@@ -70,27 +72,36 @@ make
70
  sudo make install
71
  ```
72
 
73
- Enable the `pgvector` extension in your PostgreSQL database:
74
 
75
- ```sql
76
- CREATE EXTENSION vector;
 
 
77
  ```
78
 
79
- Verify installation by checking the extension version:
80
 
81
- ```sql
82
- SELECT extversion FROM pg_extension WHERE extname = 'vector';
 
 
83
  ```
84
 
85
- ### 4. Create a Database
86
 
87
- Create an empty database to store your data:
 
 
88
 
89
- ```bash
90
- sudo -u postgres createdb your_database
 
 
 
91
  ```
92
 
93
- ### 5. Install LightRAG with API Access
94
 
95
  Install LightRAG using pip, targeting the API package for server-side use:
96
 
@@ -98,7 +109,7 @@ Install LightRAG using pip, targeting the API package for server-side use:
98
  pip install https://github.com/ParisNeo/LightRAG.git[api]
99
  ```
100
 
101
- ### 6. Configure `config.ini`
102
 
103
  Create a configuration file to specify PostgreSQL connection details and other settings:
104
 
@@ -116,7 +127,7 @@ workspace = default
116
 
117
  Replace placeholders like `your_role_name`, `your_password`, and `your_database` with actual values.
118
 
119
- ### 7. Run LightRAG Server
120
 
121
  Start the LightRAG server using specified options:
122
 
 
1
+ Certainly! Below is an updated version of the guide with instructions that ensure the `pgvector` extension is activated specifically within the database intended for use with LightRAG.
2
+
3
  # Installing and Using PostgreSQL with LightRAG
4
 
5
  This guide provides step-by-step instructions on setting up PostgreSQL for use with LightRAG, a tool designed to enhance large language model (LLM) performance using retrieval-augmented generation techniques.
 
72
  sudo make install
73
  ```
74
 
75
+ ### 4. Create a Database for LightRAG
76
 
77
+ Create an empty database to store your data:
78
+
79
+ ```bash
80
+ sudo -u postgres createdb your_database
81
  ```
82
 
83
+ ### 5. Activate PGVector Extension in the Database
84
 
85
+ Switch to the newly created database and enable the `pgvector` extension:
86
+
87
+ ```bash
88
+ sudo -u postgres psql -d your_database
89
  ```
90
 
91
+ Inside the PostgreSQL shell, run:
92
 
93
+ ```sql
94
+ CREATE EXTENSION vector;
95
+ ```
96
 
97
+ Verify installation by checking the extension version within this specific database:
98
+
99
+ ```sql
100
+ SELECT extversion FROM pg_extension WHERE extname = 'vector';
101
+ \q
102
  ```
103
 
104
+ ### 6. Install LightRAG with API Access
105
 
106
  Install LightRAG using pip, targeting the API package for server-side use:
107
 
 
109
  pip install https://github.com/ParisNeo/LightRAG.git[api]
110
  ```
111
 
112
+ ### 7. Configure `config.ini`
113
 
114
  Create a configuration file to specify PostgreSQL connection details and other settings:
115
 
 
127
 
128
  Replace placeholders like `your_role_name`, `your_password`, and `your_database` with actual values.
129
 
130
+ ### 8. Run LightRAG Server
131
 
132
  Start the LightRAG server using specified options:
133