Replace Pinecone with Postgres
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 5
- Forks
- 10
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 17
Description
Summary
- Modify
job_chatand the related servicessearch_docsiteandembed_docsto use Postgres instead of Pinecone - Leverage the Postgres database to add keyword-based search for
job_chatRAG.
Problems
job_chatcurrently only uses vector search to fetch OpenFn documentation chunks to add to the assistant prompt.
- The full/truncated, version-specific adaptor typescript definitions are copied into thejob_chatprompt. These definitions are often very long and irrelevant.
Key results
- Add keyword search: As this assistant searches through technical documentation, it would be especially useful to add more keyword-based search to the current vector similarity-based search, as this will allow searching for precise terms such as function names, and so balance the downsides of vector search. (see #284 for why Postgres)
2) Improve the core prompt: Replace the adaptor typescript definitions with a list of available functions that the model can search for. (We will optimise the processing of the adaptor documentation and upload them to the database in #285.). - Consolidate databases: Ideally, we would only manage one database, so we will save our embeddings to Postgres instead of Pinecone.
There could be problems with vector search accuracy, speed etc in job_chat, so the implementation will need to be tested check it is as good as our existing solution with Pinecone.
What needs doing:
- Modify the
embed_docsservice to make it possible to save chunks and embeddings to the Postgres database. Try adjusting chunk size from 1k to 2-3k characters. - Modify the
search_docsiteservice to include keyword search - Modify
retrieve_docs.pyin job_chat accordingly
- Modifyprompt.pyinjob_chatto remove the full adaptor docs, and replace with a list of available functions.
- Check if theprompt.pysearch scope needs to be edited. Decide on whether this should all be under "adaptor docs" from the point of view of the model doing the search, or if it should be aware of the two documentation types.
Not essential, but something to consider:
A separate, structured docs database, that is fetched not with keywords, but by sub-section title. This is similar to how Claude Code searches through a codebase, and more like a human might search through the docs. We might have different search tools available to the agent, e.g.
search_docs(query) # General search - uses hybrid internally
get_section(section_name) # Direct navigation by name
find_code_examples()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the current Pinecone flow through the job_chat, search_docsite, and embed_docs services, then inspect retrieve_docs.py. The work is done when embeddings are stored in Postgres, search_docsite supports keyword search alongside vector search, retrieve_docs.py uses the new path, and results are checked against the existing Pinecone behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- backend, databases, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100