Deploying DeepSeek on your computer teaches you to build a DeepSeek local knowledge base

For locally deployedDeepSeek,How to install and use DeepSeek R1 Big Model on your own computer?DeepSeek R1 Local Deployment Guide

How do you make it more efficient with your answers? This is where a knowledge base comes into play. The program used in this article isOllama+Docker+Dify.

976ee82bj00sskx6e005td000u0009wm

Note: First, make sure you have Git and Python installed, and that you have a "good internet connection".

I. Install Ollama and Docker and download the big model.

The methodology refers to the first and second parts of the following article: DeepSeek-R1 Local Deployment

Second, the installation of Dify (Windows as an example)

Before installing make sure that both Ollama and Docker are running, i.e. you can see the icons in the taskbar:

d16369cbj00sskx6c001rd00095005sm

Open the directory of the hard disk where you want to install Dify, click the right mouse button and select "Open in Terminal":

6ba16946j00sskx6c000qd000ao00dim

Then execute the following commands in sequence:

git clone https://github.com/langgenius/dify.git -branch 0.15.3

cd dify/docker

cp .env.example .env

docker compose up -d

When it's done, you'll see a prompt like this one, just wait for it to finish.

39c9ec05j00sskx6d001td000qt009km

The following command can be run to see if the container is running properly:

docker compose ps

In the output, you should see the following services in the leftmost column: api, db, nginx, redis, sandbox, ssrf_proxy, weaviate, web, worker

f50bffd2j00sskx6c001wd000u0004um

You can also open Docker's container bar and click on the red box to mark the part:

d5deb716j00sskx6f004id000u000jdm

The same can be seen for the services mentioned above:

c7cd3bbej00sskx6f004md000u000l8m

Next setup setup administrator account, open the URL: http://localhost/install, enter your email, username, password, confirm and log in:

df9700b6j00sskx6e001sd000ni00nxm

The installation was successful! In the future you can simply visit: http://localhost directly to open the main Dify page:

9e801da8j00sskx6e002id000u000c8m

If you can't open the page through the above URL (or jump to the Microsoft web page after opening), it may be that the default port 80 is occupied, and you need to change the port at this time:

Open the .env file in the \dify\docker folder with a text editor tool:

98e95897j00sskx6e001md000of00fum

Find the two lines below:

EXPOSE_NGINX_PORT=80

EXPOSE_NGINX_SSL_PORT=443

Modified to:

EXPOSE_NGINX_PORT=8080

EXPOSE_NGINX_SSL_PORT=8443

Save the file and run the following two lines in command line mode to restart the service:

docker compose down

docker compose up -d

At this point the default port has been changed to 8080 and you can use Dify at the following URL:

Dify setup page: http://localhost:8080/install

Dify main page: http://localhost:8080

III. Setting up the model

Dify can manage various models by clicking on your username in the top right corner and selecting "Settings" in the drop down menu:

69a92f2fj00sskx6e0045d000u000hjm

Select "Model Providers", find Ollama and click "Add Model":

7c48ed5cj00sskx6f005cd000u000l1m

Model Type Selection: LLM

The name of the model is the one that has been downloaded locally, e.g. deepseek-r1:14b.

Base URL filled in: http://host.docker.internal:11434

Then click "Save", no error message.

b49bdfbcj00sskx6e001bd000ol00lrm

Go back to the main Dify page and click "Create a blank app":

414378f0j00sskx6e002wd000u000dcm

Select "Chat Assistant", name it whatever you want, and click "Create":

2309b509j00sskx6f002id000ri00qcm

In the Chat Assistant window, in the top right corner is the model you have installed (if you can't see it, refresh the page a bit), and in the bottom right is the chat box, so you can test it out:

de612bfbj00sskx6f007nd000u000num

IV. Creating a knowledge base

In the main page of Dify, click on the top of the "Knowledge Base", at this time, you can choose to "create a knowledge base" or "connect to an external knowledge base":

174d8000j00sskx6e0026d000u000g7m

In "Create Knowledge Base", you can create an empty knowledge base or select a data source:

0dc9e11fj00sskx6e001id000t000elm

If it's an empty knowledge base, just take a name and OK it.

If you import data sources, there are a variety of ways to "import existing text" as an example, select the text file (a single file is not larger than 15MB), click Next:

e52609acj00sskx6e003ld000u000fcm

Set the settings according to your needs, and finally click "Save and Process":

55477a8fj00sskx6f007qd000u000tym

This text was then added to the knowledge base:

edf5e794j00sskx6f0052d000u000kym

Select "Add" in the "Context" field at the bottom of the chat assistant window to call up the knowledge base. At this point, if you ask a question about the content in the knowledge base, the AI will give you the appropriate answer:

8bb88c5aj00sskx6e006ed000u000hvm

At this point, a simple knowledge base for large models has been built.

Dify's knowledge base is very feature-rich, for more information on how to use it, please refer to the official documentation at the bottom of the tweet.

The article covers the URL:

Dify's Github code page

https://github.com/langgenius/dify

Dify Knowledge Base Building Official Documentation:

https://docs.dify.ai/zh-hans/guides/knowledge-base/create-knowledge-and-upload-documents

statement:The content of the source of public various media platforms, if the inclusion of the content violates your rights and interests, please contact the mailbox, this site will be the first time to deal with.
Encyclopedia

Want to use Deepseek well? 100 commonly used Deepseek commands compiled (create, learn, work, live)

2025-3-4 11:04:05

Encyclopedia

What are the software of AI automatic table generation? Recommended 3 ai one key to generate all kinds of chart tools

2025-3-5 9:33:29

Zenium
Search