-
Notifications
You must be signed in to change notification settings - Fork 243
feat(memory): add knowledgebase and memory management from LocalRecall #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ LocalAGI ensures your data stays exactly where you want it—on your hardware. N | |
| - 🤖 **Advanced Agent Teaming**: Instantly create cooperative agent teams from a single prompt. | ||
| - 📡 **Connectors**: Built-in integrations with Discord, Slack, Telegram, GitHub Issues, and IRC. | ||
| - 🛠 **Comprehensive REST API**: Seamless integration into your workflows. Every agent created will support OpenAI Responses API out of the box. | ||
| - 📚 **Short & Long-Term Memory**: Powered by [LocalRecall](https://github.com/mudler/LocalRecall). | ||
| - 📚 **Short & Long-Term Memory**: Built-in knowledge base (RAG) for collections, file uploads, and semantic search. Manage collections in the Web UI under **Knowledge base**; agents with "Knowledge base" enabled use it automatically (implementation uses [LocalRecall](https://github.com/mudler/LocalRecall) libraries). | ||
| - 🧠 **Planning & Reasoning**: Agents intelligently plan, reason, and adapt. | ||
| - 🔄 **Periodic Tasks**: Schedule tasks with cron-like syntax. | ||
| - 💾 **Memory Management**: Control memory usage with options for long-term and summary memory. | ||
|
|
@@ -108,7 +108,7 @@ Still having issues? see this Youtube video: https://youtu.be/HtVwIxW3ePg | |
| </td> | ||
| <td width="50%" valign="top"> | ||
| <h3><a href="https://github.com/mudler/LocalRecall">LocalRecall</a></h3> | ||
| <p>A REST-ful API and knowledge base management system that provides persistent memory and storage capabilities for AI agents.</p> | ||
| <p>A REST-ful API and knowledge base management system. LocalAGI embeds this functionality: the Web UI includes a <strong>Knowledge base</strong> section and the same collections API, so you no longer need to run LocalRecall separately.</p> | ||
| </td> | ||
| </tr> | ||
| </table> | ||
|
|
@@ -239,11 +239,13 @@ LocalAGI supports environment configurations. Note that these environment variab | |
| | `LOCALAGI_LLM_API_KEY` | API authentication | | ||
| | `LOCALAGI_TIMEOUT` | Request timeout settings | | ||
| | `LOCALAGI_STATE_DIR` | Where state gets stored | | ||
| | `LOCALAGI_LOCALRAG_URL` | LocalRecall connection | | ||
| | `LOCALAGI_BASE_URL` | Optional base URL for the app (only relevant when using an external LocalRAG URL; not used for built-in knowledge base) | | ||
| | `LOCALAGI_ENABLE_CONVERSATIONS_LOGGING` | Toggle conversation logs | | ||
| | `LOCALAGI_API_KEYS` | A comma separated list of api keys used for authentication | | ||
| | `LOCALAGI_CUSTOM_ACTIONS_DIR` | Directory containing custom Go action files to be automatically loaded | | ||
|
|
||
| For the built-in knowledge base, optional env (defaults use `LOCALAGI_STATE_DIR`): `COLLECTION_DB_PATH`, `FILE_ASSETS`, `VECTOR_ENGINE` (e.g. `chromem`, `postgres`), `EMBEDDING_MODEL`, `DATABASE_URL` (when `VECTOR_ENGINE=postgres`). | ||
|
|
||
| Skills are stored in a fixed `skills` subdirectory under `LOCALAGI_STATE_DIR` (e.g. `/pool/skills` in Docker). Git repo config for skills lives in that directory. No extra environment variables are required. | ||
|
|
||
| ## Installation Options | ||
|
|
@@ -339,15 +341,16 @@ import ( | |
| "github.com/mudler/LocalAGI/core/types" | ||
| ) | ||
|
|
||
| // Create a new agent pool | ||
| // Create a new agent pool (call pool.SetRAGProvider(...) for knowledge base; see main.go) | ||
| pool, err := state.NewAgentPool( | ||
| "default-model", // default model name | ||
| "default-multimodal-model", // default multimodal model | ||
| "image-model", // image generation model | ||
| "transcription-model", // default transcription model | ||
| "en", // default transcription language | ||
| "tts-model", // default TTS model | ||
| "http://localhost:8080", // API URL | ||
| "your-api-key", // API key | ||
| "./state", // state directory | ||
| "http://localhost:8081", // LocalRAG API URL | ||
| "your-api-key", // API key | ||
| "./state", // state directory | ||
| func(config *AgentConfig) func(ctx context.Context, pool *AgentPool) []types.Action { | ||
| // Define available actions for agents | ||
| return func(ctx context.Context, pool *AgentPool) []types.Action { | ||
|
|
@@ -374,8 +377,9 @@ pool, err := state.NewAgentPool( | |
| // Add your custom filters here | ||
| } | ||
| }, | ||
| "10m", // timeout | ||
| true, // enable conversation logs | ||
| "10m", // timeout | ||
| true, // enable conversation logs | ||
| nil, // skills service (optional) | ||
| ) | ||
|
|
||
| // Create a new agent in the pool | ||
|
|
@@ -741,7 +745,7 @@ export LOCALAGI_MODEL=gemma-3-4b-it-qat | |
| export LOCALAGI_MULTIMODAL_MODEL=moondream2-20250414 | ||
| export LOCALAGI_IMAGE_MODEL=sd-1.5-ggml | ||
| export LOCALAGI_LLM_API_URL=http://localai:8080 | ||
| export LOCALAGI_LOCALRAG_URL=http://localrecall:8080 | ||
| # Knowledge base is built-in; no separate LocalRecall service needed | ||
| export LOCALAGI_STATE_DIR=./pool | ||
| export LOCALAGI_TIMEOUT=5m | ||
| export LOCALAGI_ENABLE_CONVERSATIONS_LOGGING=false | ||
|
|
@@ -1045,7 +1049,7 @@ LocalAGI supports environment configurations. Note that these environment variab | |
| | `LOCALAGI_LLM_API_KEY` | API authentication | | ||
| | `LOCALAGI_TIMEOUT` | Request timeout settings | | ||
| | `LOCALAGI_STATE_DIR` | Where state gets stored | | ||
| | `LOCALAGI_LOCALRAG_URL` | LocalRecall connection | | ||
| | `LOCALAGI_BASE_URL` | Optional base URL for built-in knowledge base (default `http://localhost:3000`) | | ||
|
||
| | `LOCALAGI_SSHBOX_URL` | LocalAGI SSHBox URL, e.g. user:pass@ip:port | | ||
| | `LOCALAGI_ENABLE_CONVERSATIONS_LOGGING` | Toggle conversation logs | | ||
| | `LOCALAGI_API_KEYS` | A comma separated list of api keys used for authentication | | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description mentions that the old 'LOCALAGI_LOCALRAG_URL' is replaced, but the table entry now says 'LOCALAGI_BASE_URL' with a different description. This is confusing. If LOCALAGI_BASE_URL is a new variable that serves a different purpose, it should be clearly documented. If it's meant to replace LOCALAGI_LOCALRAG_URL, the description should reflect that more clearly and mention backward compatibility.