cormanz / smartgpt Goto Github PK
View Code? Open in Web Editor NEWA program that provides LLMs with the ability to complete complex tasks using plugins.
License: MIT License
A program that provides LLMs with the ability to complete complex tasks using plugins.
License: MIT License
warning: `smartgpt` (lib) generated 20 warnings (run `cargo fix --lib -p smartgpt` to apply 15 suggestions)
Finished release [optimized] target(s) in 0.14s
warning: the following packages contain code that will be rejected by a future version of Rust: xml5ever v0.16.2
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
Running `target/release/smartgpt`
Error: No plugin named "newsapi".
if i had it working on software. where dfid it put the completed software.
This is a major issue that will revamp how SmartGPT works.
Projects like SwarmGPT show the potential of large amounts of parallelized agents working together. Meanwhile, SmartGPT has still had great results with the hierarchical system. Alongside this, papers such as the Generative Agents: Interactive Simulacra of Human Behavior paper show the power of giving agents the ability to have memories and self-reflect.
This issue proposes a new major feature: Smart Agents.
Smart Agents have three separate contexts that handle different parts of their processing.
Brainstormer: All agents have a Brainstormer context. This handles short-term memory: specifically, it handles brainstorming ideas and short-term thoughts and plans. This handles all of the current tasks, thoughts, etc.
Reflector: The Reflector context though, does equally important work in the background. It handles long-term memory: chunking short-term observations together via self-reflection, pruning old memories, long-term planning, and keeping track of the final end goals.
Then, depending on whether or not it is an employee or a manager, it has one additional context, called an Actor. There are two types of Actor contexts: Executors and Delegators.
Executor: For employees, the Executor context takes the ideas from the Brainstormer, and finds out how to turn them into commands. It'll also extract useful information so that the Brainstormer and Reflector can more easily process it.
Delegator: For managers, the Delegator context takes the ideas from the Brainstormer, and delegates them as tasks to its employees. Then, it collaborates with those employees to ensure the tasks are carried out successfully.
All three of these contexts come together to form the Agent. Here's how it works in Employees.
The Reflector analyzes the problem; then the Brainstormer begins brainstorming ideas. The Brainstormer and Executor work together frequently, the Brainstormer giving ideas, the Executor executing them. Meanwhile, the Reflector works in the background, sorting through these new memories, and reflecting them. It makes sure the Brainstormer and Executor are working towards this goal.
Finally, the contexts also have one additional type of memory that is shared: The Web. The Web is just a network of embeddings; the contexts store information there, and can search for it later.
Smart Agents also have one other key feature: they're built to be dynamic.
Currently, SmartGPT uses a static system of layers for how your program is organized. You start from the top manager, then go down to the lowest employee. This doesn't scale well, though.
SmartGPT will still start from the top agent. However, each agent will decide whether it should be an employee or a manager, and it can change its role later on, too. A manager can also have multiple employees working in parallel.
Dynamic Agents are a future feature that Smart Agents is meant to built on top off.
Whether we use the Brainstormer, Reflector, Actor architecture is uncertain. However, the idea of Smart Agents and having some sort of internal contexts helping keep it organized is likely key, so we aim to prioritize this.
Papers like the Generative Agents: Interactive Simulacra of Human Behavior paper and the Reflexion: an autonomous agent with dynamic memory and self-reflection paper, alongside the GPT 4 is Smarter than You Think: Introducing SmartGPT video (which is unrelated to this project, but named similarly) document significant performance improvements when giving agents the ability to self-reflect. We should try to add self-reflection to SmartGPT as well.
here are the error messages:
warning: `smartgpt` (bin "smartgpt") generated 17 warnings
Finished release [optimized] target(s) in 7.44s
Running `target\release\smartgpt.exe`
Error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
error: process didn't exit successfully: `target\release\smartgpt.exe` (exit code: 1)
beforehand there is a string of warnings:
(base) PS C:\Users\Zenchant\Documents\ALL-AGI\smartgpt> cargo run --release
Compiling smartgpt v0.1.0 (C:\Users\Zenchant\Documents\ALL-AGI\smartgpt)
warning: unnecessary trailing semicolon
--> src\plugins\wikipedia\mod.rs:86:110
|
86 | let name: String = args.get(0).ok_or(CommandNoArgError("wikipedia-browse", "name"))?.clone().try_into()?;;
| ^ help: remove this semicolon
|
= note: `#[warn(redundant_semicolons)]` on by default
warning: use of deprecated trait `std::ascii::AsciiExt`: use inherent methods instead
--> src\config.rs:1:68
|
1 | use std::{collections::HashMap, error::Error, fmt::Display, ascii::AsciiExt, process, sync::{Mutex, Arc}};
| ^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated trait `std::ascii::AsciiExt`: use inherent methods instead
--> src\agents\minion\continuous.rs:1:32
|
1 | use std::{error::Error, ascii::AsciiExt};
| ^^^^^^^^
warning: unreachable expression
--> src\agents\manager.rs:128:5
|
48 | / loop {
49 | | let ProgramInfo { context, .. } = program;
50 | | let mut context = context.lock().unwrap();
51 | |
... |
125 | | }
126 | | }
| |_____- any code following this expression is unreachable
127 |
128 | Ok(())
| ^^^^^^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unused import: `ascii::AsciiExt`
--> src\config.rs:1:61
|
1 | use std::{collections::HashMap, error::Error, fmt::Display, ascii::AsciiExt, process, sync::{Mutex, Arc}};
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `ascii::AsciiExt`
--> src\agents\minion\continuous.rs:1:25
|
1 | use std::{error::Error, ascii::AsciiExt};
| ^^^^^^^^^^^^^^^
warning: variable `first_prompt` is assigned to, but never used
--> src\agents\manager.rs:44:13
|
44 | let mut first_prompt = true;
| ^^^^^^^^^^^^
|
= note: consider using `_first_prompt` instead
= note: `#[warn(unused_variables)]` on by default
warning: value assigned to `first_prompt` is never read
--> src\agents\manager.rs:67:9
|
67 | first_prompt = false;
| ^^^^^^^^^^^^
|
= help: maybe it is overwritten before being read?
= note: `#[warn(unused_assignments)]` on by default
warning: function `debug_yaml` is never used
--> src\main.rs:37:4
|
37 | fn debug_yaml(results: &str) -> Result<(), Box<dyn Error>> {
| ^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function `generate_goals` is never used
--> src\prompt.rs:84:4
|
84 | fn generate_goals(goals: &[String]) -> String {
| ^^^^^^^^^^^^^^
warning: function `test` is never used
--> src\agents\mod.rs:56:8
|
56 | pub fn test() {
| ^^^^
warning: function `try_parse_yaml` is never used
--> src\agents\mod.rs:61:8
|
61 | pub fn try_parse_yaml<T : DeserializeOwned>(llm: &LLM, tries: usize, max_tokens: Option<u16>) -> Result<(String...
| ^^^^^^^^^^^^^^
warning: variants `Manager`, `Boss`, and `Employee` are never constructed
--> src\agents\mod.rs:99:5
|
98 | pub enum Agent {
| ----- variants in this enum
99 | Manager,
| ^^^^^^^
100 | Boss,
| ^^^^
101 | Employee
| ^^^^^^^^
|
= note: `Agent` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
warning: variant `Feedback` is never constructed
--> src\agents\boss.rs:11:5
|
9 | pub enum Task {
| ---- variant in this enum
10 | Task(String),
11 | Feedback(String, String)
| ^^^^^^^^
|
= note: `Task` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
warning: function `run_lua_minion` is never used
--> src\agents\minion\lua.rs:11:8
|
11 | pub fn run_lua_minion(
| ^^^^^^^^^^^^^^
warning: unused `Result` that must be used
--> src\runner\mod.rs:26:5
|
26 | / run_script(
27 | | &mut program,
28 | | r#"wikipedia_browse("Ronald Reagan")"#,
29 | | &Lua::new()
30 | | );
| |_____^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
warning: unused `Result` that must be used
--> src\agents\minion\continuous.rs:166:13
|
166 | context.agents.minion.llm.crop_to_tokens_remaining(1800);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
warning: `smartgpt` (bin "smartgpt") generated 17 warnings
When doing testing, gpt-3.5-turbo tends to struggle a lot with formatting JSON queries. It sometimes responds with plaintext and then gives the JSON query, or messes up the format.
This issue proposes two suggested changes.
Alongside this, it also might be a good idea to use YML for prompt token reduction and for making it easier for LLMs to understand the prompt. However, whether this is better than JSON is uncertain (it hasn't proven reliable in my light testing.)
for google use curl
for openAI check https://github.com/FlamingFury00/Free-AUTO-GPT-with-NO-API
or through nat.dev https://nat.dev 's backend api
wolfram "
news "
I can add more info when it is not clear how to go about it.
Compiling smartgpt v0.1.0 (/home/x/dev/python/ai/smartgpt)
error[E0583]: file not found for module `assets`
--> src/plugins/mod.rs:5:1
|
5 | mod assets;
| ^^^^^^^^^^^
|
= help: to create the module `assets`, create file "src/plugins/assets.rs" or "src/plugins/assets/mod.rs"
error[E0432]: unresolved import `crate::create_assets`
--> src/api/config/mod.rs:7:298
|
7 | ...y_qdrant, MemorySystem, create_memory_redis, create_assets, PluginStore, create_brainstorm, SmartGPT};
| ^^^^^^^^^^^^^
| |
| no `create_assets` in the root
| help: a similar name exists in the module: `create_news`
warning: unused import: `Deserialize`
--> src/plugin.rs:4:46
|
4 | use serde::{Serialize, de::DeserializeOwned, Deserialize};
| ^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `AutoType`
--> src/plugin.rs:29:45
|
29 | use crate::{LLM, ScriptValue, MemorySystem, AutoType};
| ^^^^^^^^
warning: unused import: `serde::Serialize`
--> src/api/smartgpt.rs:3:5
|
3 | use serde::Serialize;
| ^^^^^^^^^^^^^^^^
warning: unused imports: `LLMModel`, `LLMProvider`
--> src/api/smartgpt.rs:6:61
|
6 | use crate::{CommandContext, PluginStore, Agents, AgentInfo, LLMProvider, LLMModel, LLM, ChatGPTProvider, ChatGPTConfig, memory_from_provider, LocalProvider, auto::{...
| ^^^^^^^^^^^ ^^^^^^^^
warning: unused import: `AgentInfo`
--> src/auto/agents/worker/mod.rs:2:23
|
2 | use crate::{SmartGPT, AgentInfo, auto::{run::Action, DisallowedAction}};
| ^^^^^^^^^
warning: unused import: `colored::Colorize`
--> src/auto/agents/worker/adept.rs:2:5
|
2 | use colored::Colorize;
| ^^^^^^^^^^^^^^^^^
warning: unused import: `log_yaml`
--> src/auto/agents/worker/adept.rs:5:90
|
5 | use crate::{CommandContext, AgentInfo, Message, auto::{try_parse_json, agents::{worker::{log_yaml, run_method_agent}}, run::Action, DisallowedAction, DynamicUpdate}...
| ^^^^^^^^
warning: unused import: `colored::Colorize`
--> src/auto/agents/worker/methodical.rs:3:5
|
3 | use colored::Colorize;
| ^^^^^^^^^^^^^^^^^
warning: unused import: `log_yaml`
--> src/auto/agents/worker/methodical.rs:8:13
|
8 | use super::{log_yaml, use_tool};
| ^^^^^^^^
Some errors have detailed explanations: E0432, E0583.
For more information about an error, try `rustc --explain E0432`.
warning: `smartgpt` (lib) generated 9 warnings
error: could not compile `smartgpt` due to 2 previous errors; 9 warnings emitted
warning: build failed, waiting for other jobs to finish...
The errors provided, like a missing config, are not good or provided, #6 highlights this problem.
Also, sidenote, the config should be checked at runtime, not compilation.
Would it be possible to provide a more concrete example of how to use it, in the README file?
Like an example where we ask it a specific question and save the result as a file (though STDOUT would be good enough, honestly!).
Alas, the README was just slightly over my head, but only slightly.
It's a great project, but since most GPT programmers know Python, if you implement a Python version, it will attract more attention.
I hope to add proxy configuration in yml
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
you need create the "files" folder before run smartgpt
Currently, the context gets cut off after 4,000 tokens if it thinks for too long.
Perhaps we could auto-cut the context down to say 3,000 tokens? Any lost context could be turned into observations.
Thanks!
It seems like a good idea to integrate headless browsers using a Rust crate such as thirtyfour to allow for fast, performant, and easy access to existing plugins that rely on websites without needing API keys for setting up tools such as google
, which can be complicated for some users. It could also make it much easier to implement new tools and APIs.
It is possible to create a cross-platform dynamic library using LLVM that can be imported by Rust on various systems. LLVM, a collection of modular and reusable compiler and toolchain technologies, generates an intermediate representation (IR) code that provides a certain level of abstraction from the platform. Rust has the capability to link against these dynamically generated libraries.
However, creating such a library involves dealing with some complexities:
Cross-platform development requires handling specific aspects tailored to different platforms in your codebase while maintaining general compatibility across all target platforms.
Addressing ABI (Application Binary Interface) compatibility issues between languages when linking together compiled components may require extra consideration during implementation stages.
Configuring build scripts are essential for ensuring correct compilation results, and it'd be frustrating with a lot of boilerplate for every plugin made.
Recently, Google's PALM2 model has proven to be a ready competitor to OpenAI's GPT4. For further testing, we should try to integrate it with SmartGPT, but no Rust API for the model exists, which makes this more difficult.
We should try to see if we can integrate with PALM2 using the REST API if possible.
In the interest of continued SmartGPT development, I've purchased the smartgpt.dev
domain. It would be a good idea to try to create a minimal website for organizing all of the project information in one space and perhaps launching some sort of blog.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.