Skip to content

Conversation

@isthaison
Copy link
Contributor

@isthaison isthaison commented Mar 15, 2025

What problem does this PR solve?

Add history version save

  • Allows users to view and download agent files by version revision history
    image

Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

@KevinHuSh KevinHuSh changed the title add history version save Feat: support agent version history. Mar 17, 2025
@KevinHuSh
Copy link
Collaborator

Appreciation! Good feature.

All the versions of are saved in local files, which is not a scalable design. Could you refine it by saving them to MySQL?
You could initiate a new table in db_models.py here:
image

And a service class is needed to get/set data from DB like those:
image

@KevinHuSh KevinHuSh added the wip label Mar 17, 2025
@isthaison
Copy link
Contributor Author

I don't have much experience with mysql, but I will try

@isthaison
Copy link
Contributor Author

Hi @KevinHuSh, It's ready

@isthaison
Copy link
Contributor Author

Can I add more feature. Example: model settings agent, agent list by team.

@KevinHuSh
Copy link
Collaborator

What about #6155 if you're interested in?
image

In term of back end, it needs a new DB table to store the configuration of a given user.

@asiroliu
Copy link
Collaborator

asiroliu commented Mar 18, 2025

@isthaison @KevinHuSh
Apologies, I built a new Docker image using your PR (#6130 ), but there are functional defects in the implementation.

  1. build docker image
$ git clone -b agent-history git@github.com:isthaison/ragflow.git ragflow_6310
$ cd ragflow_6310/
$ git log
commit 6ecbde83ac5fe6c3f1df3ffdd4559c2c54b76d0f (HEAD -> agent-history, origin/agent-history)
Author: so95 <is.thaison@gmail.com>
Date:   Mon Mar 17 17:51:39 2025 +0700

    fixed show create date
...
$ docker build --progress=plain --build-arg LIGHTEN=1 --build-arg NEED_MIRROR=1 -f Dockerfile -t infiniflow/ragflow:ni
ghtly-slim .
  1. start ragflow service
$ cd docker
$ sed -i 's#^RAGFLOW_IMAGE=.*#RAGFLOW_IMAGE=infiniflow/ragflow:nightly-slim#' .env
$ docker compose -f docker-compose.yml up -d
  1. Create an agent using the Customer Service template and save it.
    image
  2. Download the JSON configuration file, then open a new empty agent to import it, but an error occurred.
    image

Operation Workflow:
20250318151249_rec_

@isthaison
Copy link
Contributor Author

@asiroliu Could you try again. I have adjusted it, so that it can be imported.

@asiroliu
Copy link
Collaborator

@isthaison
Great! Using the latest commit (a260717), the import issue has been resolved.

@asiroliu
Copy link
Collaborator

@isthaison @KevinHuSh
The preview image is misaligned

  1. Create an agent using the Customer Service template and save it.
  2. Delete the note component, then save it.
  3. The note component is still present in the latest save preview.
  4. Delete the other note component, then save it.
  5. The first deleted note component has disappeared in the preview, but the second deleted note component is still present.

20250318153326_rec_

@isthaison
Copy link
Contributor Author

Hi @asiroliu, the list history don't include the latest version

@isthaison
Copy link
Contributor Author

I had change logic save version. Would you like trying to again

@asiroliu
Copy link
Collaborator

@isthaison @KevinHuSh
Great work! I tested the latest commit (1f50f4f), and the preview image now matches the saved state.
I believe this PR is ready to be merged into the main branch.

@KevinHuSh KevinHuSh added ci Continue Integration and removed wip labels Mar 19, 2025
@KevinHuSh KevinHuSh merged commit 53ac27c into infiniflow:main Mar 19, 2025
2 checks passed
@isthaison isthaison deleted the agent-history branch March 19, 2025 07:26
@KevinHuSh
Copy link
Collaborator

What about #6155 if you're interested in? image

In term of back end, it needs a new DB table to store the configuration of a given user.

FYI: This feature has been taken.

@isthaison
Copy link
Contributor Author

If so, that would be fine.

@isthaison
Copy link
Contributor Author

Shall we start building it?

liwenju0 pushed a commit to liwenju0/ragflow that referenced this pull request Mar 20, 2025
### What problem does this PR solve?
Add history version save
- Allows users to view and download agent files by version revision
history

![image](https://github.com/user-attachments/assets/c300375d-8b97-4230-9fc4-83d148137132)

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
Copy link

@Chikage0o0 Chikage0o0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker path mapping recommendation

- ./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf
- ./nginx/proxy.conf:/etc/nginx/proxy.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ../history_data_agent:/ragflow/history_data_agent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, files should be stored in the docker folder for easy migration, just like logs

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be removed, since history is saved in DB now.

@KevinHuSh KevinHuSh mentioned this pull request Apr 14, 2025
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants