-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Postgres for the doc and index store #1706
Conversation
Published docs preview URL: https://privategpt-preview-b21514e6-e8d4-4cc1-acfb-3f02e15bf1c0.docs.buildwithfern.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good addition! Added a couple minor comments.
Also, an important one: we need to update pyproject.toml to include as optional
llama-index-storage-docstore-postgres and llama-index-storage-index-store-postgres; with that update the installation docs, etc. I can help with that if needed.
It'd be great to add specific documentation about this addition, the same way we already have a section about vector stores at https://docs.privategpt.dev/manual/storage/vector-stores
…s storage dependencies
Published docs preview URL: https://privategpt-preview-8d423160-4bee-4d3d-8cf6-5d4451f2de73.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-caaf875a-9e97-4c67-8ada-a60ee07912c9.docs.buildwithfern.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is looking great! I've just noticed one thing about the naming: we should call it nodestore everywhere (instead of docstore or DocIndexStore) for consistency; given the original component is NodeStoreComponent, I'd stick to that name.
Published docs preview URL: https://privategpt-preview-85df3a2c-cf76-4562-941b-34f7d065ef72.docs.buildwithfern.com |
Hi guys. I have this version running. There is some typos in the doc and a syntax error in the node_component.py but i got it up and running. Something is very wrong when querying files compared to before. I put an example in a thread in Discord. I don't know if it's the embedding that goes wrong or something else, but if I embed the same document directly in the running Ollama instance i get much better answers (same model / document) |
Published docs preview URL: https://privategpt-preview-eee69d81-894a-48c0-a48c-bba7ddeb6cc3.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-ef04864f-9492-492a-89ef-957608531884.docs.buildwithfern.com |
Those should both be fixed now. What discord thread? |
Summing up: @HenrikPedDK found that using Postgres for doc and index store makes the Query Docs not work properly. I haven't tested it myself, so it is not a 100% confirmed issue (at least not the direct relation with these changes). Copying @HenrikPedDK feedback here from Discord (moving the convo to Discord is not a good practice; having said that, happy to also chat in Discord ): Okay, i have ingested a cook book that i usually test with. Before using Postgres as index/docstore i could query for a specific recipe. It can't do that anymore, it summarizes the book okay but when asking into specific things it gives answers like this: "I apologize for any confusion earlier, but I cannot directly provide you with the Cassoulet recipe from "Cast Iron Cooking For Dummies" as I don't have access to the actual text of the book. However, I can give you a basic outline and ingredients list for making a traditional French Cassoulet in a cast iron Dutch oven or casserole dish." Mistral:Latest 12/03/2024 13:52 INGREDIENTS 4 tablespoons olive oil ½ pound haricot coverts (green beans), cleaned 1 shallot, sliced 2 cloves garlic, sliced 1 tablespoon butter ¼ cup almonds, sliced Salt and pepper to taste Red pepper flakes to taste 1 pound lamb shoulder, medium diced 1 pound pork shoulder, medium diced Salt and pepper, to taste 2 onions, small diced 4 garlic cloves, minced 2 tablespoons tomato paste 4 Roma tomatoes, small diced 1 teaspoon sugar 1 pound dry white beans, great northern, presoaked overnight 2 quarts chicken stock 4 sprigs thyme 2 bay leaves 3 sprigs parsley, separate leaves (mince) from stems (reserve) 3 slices bacon, medium diced 2 cups panko breadcrumbs 1 lemon zest COOK TIME: 2 hours PREP TIME: 10 minutes YIELD: 8 servings Heat the oil in a Dutch oven or large pot. Add the green beans, shallot, and garlic. Cook until tender, about 5 minutes. Remove from the pot and set aside. Preheat the oven to 375 degrees Fahrenheit. In the same pot, heat the butter. When it's melted, add the almonds. Cook for 2 minutes, then remove them and set aside with the green beans. Season the lamb and pork with salt and pepper to taste. In the same pot, cook the meats until browned on all sides. Remove and set aside with the green beans and almonds. In the same pot, heat 2 tablespoons oil. Add the onions and garlic. Cook for 3 minutes, then remove them and set aside. Heat 1 more tablepoon of oil in the same pot. Add the tomato paste. Cook for 2 minutes. Then add the Roma tomatoes, sugar, and cooked white beans. Stir well to combine, then add chicken stock, thyme sprigs, bay leaves, and parsley stems. ( i removed the rest) |
Published docs preview URL: https://privategpt-preview-8bc95da3-378c-4c5d-b816-c0b6ecd62e1e.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-f2213fe4-3a3f-4f79-aad6-80abc6b70fa1.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-b227b1ce-610c-49f1-bc38-7b4c7637a4b3.docs.buildwithfern.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super small doc typos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment to fix the only pending linting error.
Forget about the fern error, I'll disable that check in the near future
Published docs preview URL: https://privategpt-preview-2d55fa7f-465b-4eb5-b459-fbc1dd98887d.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-c71918ec-2940-426a-a980-a052b866243b.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-205a210d-9c7c-4156-b631-bb7b137a754f.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-7d37bc63-c51a-4498-9bdb-88cd9ad81ecf.docs.buildwithfern.com |
Published docs preview URL: https://privategpt-preview-91853425-872c-4d06-ac34-b419b80a19df.docs.buildwithfern.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution and execution!
Adding Postgres support for the Doc and Index store.
Provided example using ollama and everything stored in Postgres.
One thing that is a little unusual is that if you are using the same postgres DB for both the Docstore and the Vector store
you need to supply the credentials twice. This is has both benefit and downsides.