diff --git a/surfsense_backend/draw.py b/surfsense_backend/draw.py new file mode 100644 index 0000000..ec55f79 --- /dev/null +++ b/surfsense_backend/draw.py @@ -0,0 +1,5 @@ +from app.agents.researcher.graph import graph as researcher_graph +from app.agents.researcher.sub_section_writer.graph import graph as sub_section_writer_graph + +print(researcher_graph.get_graph().draw_mermaid()) +print(sub_section_writer_graph.get_graph().draw_mermaid()) \ No newline at end of file diff --git a/surfsense_web/content/docs/index.mdx b/surfsense_web/content/docs/index.mdx index e99f597..b2a96d6 100644 --- a/surfsense_web/content/docs/index.mdx +++ b/surfsense_web/content/docs/index.mdx @@ -1,7 +1,87 @@ --- -title: Welcome Docs +title: Prerequisites +description: Required setup's before setting up SurfSense +full: true --- - -## Introduction - -I love Docs. \ No newline at end of file + +## PGVector installation Guide + +SurfSense requires the pgvector extension for PostgreSQL: + +### Linux and Mac + +Compile and install the extension (supports Postgres 13+) + +```sh +cd /tmp +git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git +cd pgvector +make +make install # may need sudo +``` + +See the [installation notes](https://github.com/pgvector/pgvector/tree/master#installation-notes---linux-and-mac) if you run into issues + +### Windows + +Ensure [C++ support in Visual Studio](https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#download-and-install-the-tools) is installed, and run: + +```cmd +call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" +``` + +Note: The exact path will vary depending on your Visual Studio version and edition + +Then use `nmake` to build: + +```cmd +set "PGROOT=C:\Program Files\PostgreSQL\16" +cd %TEMP% +git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git +cd pgvector +nmake /F Makefile.win +nmake /F Makefile.win install +``` + +See the [installation notes](https://github.com/pgvector/pgvector/tree/master#installation-notes---windows) if you run into issues + + + +## File Upload's + +Files are converted to LLM friendly formats using [Unstructured](https://github.com/Unstructured-IO/unstructured) + +1. Get an Unstructured.io API key from [Unstructured Platform](https://platform.unstructured.io/) +2. You should be able to generate API keys once registered +![Image](/docs/unstructured.png) + +## Google OAuth Setup + +SurfSense user management and authentication works on Google OAuth. + +1. Set up OAuth Client at [Google Developer Console](https://developers.google.com/identity/protocols/oauth2) +2. Enable People API. +3. Note your OAuth Client. + +## LLM Observability (Optional) + +For monitoring LLM interactions: + +1. Get a LangSmith API key from [smith.langchain.com](https://smith.langchain.com/) +2. This helps in observing SurfSense Researcher Agent operations + +## Crawler Support + +SurfSense currently uses [Firecrawl.py](https://www.firecrawl.dev/) for web crawling. + +## API Keys + +Prepare the following API keys: + +1. LLM API keys (OpenAI, Gemini, etc.) based on your selected models +2. Unstructured.io API key +3. Firecrawl API key (if using the crawler) + +## Next Steps + +Once you have all prerequisites in place, proceed to the [installation guide](/docs/installation) to set up SurfSense. \ No newline at end of file diff --git a/surfsense_web/content/docs/meta.json b/surfsense_web/content/docs/meta.json new file mode 100644 index 0000000..e5bb280 --- /dev/null +++ b/surfsense_web/content/docs/meta.json @@ -0,0 +1,9 @@ +{ + "title": "Setup", + "description": "The setup guide for Surfsense", + "root": true, + "pages": [ + "---Setup---", + "index" + ] + } \ No newline at end of file diff --git a/surfsense_web/public/docs/google_oauth_client.png b/surfsense_web/public/docs/google_oauth_client.png new file mode 100644 index 0000000..f49650b Binary files /dev/null and b/surfsense_web/public/docs/google_oauth_client.png differ diff --git a/surfsense_web/public/docs/people_api.png b/surfsense_web/public/docs/people_api.png new file mode 100644 index 0000000..070fda2 Binary files /dev/null and b/surfsense_web/public/docs/people_api.png differ diff --git a/surfsense_web/public/docs/unstructured.png b/surfsense_web/public/docs/unstructured.png new file mode 100644 index 0000000..861a847 Binary files /dev/null and b/surfsense_web/public/docs/unstructured.png differ