From 8ac2d8010e11f3bbd768a74f111a12d647169496 Mon Sep 17 00:00:00 2001 From: Shishir Patil Date: Sun, 15 Oct 2023 16:58:33 -0700 Subject: [PATCH] Read from SQL - minimal changes --- README.md | 29 +++++++++++++++++++++++++++++ requirements.txt | 1 + test.db | Bin 0 -> 8192 bytes 3 files changed, 30 insertions(+) create mode 100644 test.db diff --git a/README.md b/README.md index d4519070..aa76123c 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,35 @@ While using MemGPT via the CLI you can run various commands: send a memory warning system message to the agent ``` +## Use MemGPT to talk to your Database! + +MemGPT's archival memory let's you load your database and talk to it! To motivate this use-case, we have included a toy example. + +Consider the `test.db` already included in the repository. + +id | name | age +--- | --- | --- +1 | Alice | 30 +2 | Bob | 25 +3 | Charlie | 35 + +To talk to this database, run: + +```sh +python main_db.py +``` + +And then you can input the path to your database, and your query. + +```python +Please enter the path to the database. test.db +... +Enter your message: How old is Bob? +... +🤖 Bob is 25 years old. +``` + + ### Support * By default MemGPT will use `gpt-4`, so your API key will require `gpt-4` API access. diff --git a/requirements.txt b/requirements.txt index 05112350..a66f3043 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ numpy absl-py pybars3 faiss-cpu +sqlite3 diff --git a/test.db b/test.db new file mode 100644 index 0000000000000000000000000000000000000000..d238b8edf597c8a8a09aa13a2fc9372587e91336 GIT binary patch literal 8192 zcmeI#PfEi;6bA73(m*9B5xOW6kOyuQN;kcLX&I!nil(!$%Sk)hK+;0VrW?^?c^6OM z+5$DNUN&Vslu$L84-7G|Ai_TtF%sm1+OdKR!xZI1J7X3xI? DPQf#s literal 0 HcmV?d00001