base on :brain: 100% Local Memory layer and Knowledge base for agents with WebUI <p align="center">
<img src="./static/logo.png" alt="LocalRecall Logo" width="220"/>
</p>
<h3 align="center"><em>Your AI. Your Hardware. Your Rules.</em></h3>
<div align="center">
[](https://goreportcard.com/report/github.com/mudler/LocalRecall)
[](https://opensource.org/licenses/MIT)
[](https://github.com/mudler/LocalRecall/stargazers)
[](https://github.com/mudler/LocalRecall/issues)
</div>
A lightweight, no-frills RESTful API designed for managing knowledge bases and files stored in vector databasesβ**no GPU, internet, or cloud services required**! LocalRecall provides a simple and generic abstraction layer to handle knowledge retrieval, ideal for AI agents and chatbots to manage both long-term and short-term memory seamlessly.
Currently, LocalRecall is batteries included and supports a local vector store powered by **Chromem**, with plans to add additional vector stores such as **Milvus** and **Qdrant**. It can easily integrate with LocalAI, LocalAGI, and other agent frameworks, offering an intuitive web UI for convenient file management, including support for raw text inputs.
## ππ Local Stack Family
π LocalAI is now part of a comprehensive suite of AI tools designed to work together:
<table>
<tr>
<td width="50%" valign="top">
<a href="https://github.com/mudler/LocalAI">
<img src="https://raw.githubusercontent.com/mudler/LocalAI/refs/heads/master/core/http/static/logo_horizontal.png" width="300" alt="LocalAI Logo">
</a>
</td>
<td width="50%" valign="top">
<h3><a href="https://github.com/mudler/LocalAI">LocalAI</a></h3>
<p>LocalAI is the free, Open Source OpenAI alternative. LocalAI act as a drop-in replacement REST API that's compatible with OpenAI API specifications for local AI inferencing. Does not require GPU.</p>
</td>
</tr>
<tr>
<td width="50%" valign="top">
<a href="https://github.com/mudler/LocalAGI">
<img src="https://raw.githubusercontent.com/mudler/LocalAGI/refs/heads/main/webui/react-ui/public/logo_2.png" width="300" alt="LocalAGI Logo">
</a>
</td>
<td width="50%" valign="top">
<h3><a href="https://github.com/mudler/LocalAGI">LocalAGI</a></h3>
<p>A powerful Local AI agent management platform that serves as a drop-in replacement for OpenAI's Responses API, enhanced with advanced agentic capabilities.</p>
</td>
</tr>
</table>
---
## π Features
- β‘ **RESTful API**: Simple and intuitive REST interface for knowledge management.
- π‘ **Fully Local**: Operates offline without external cloud dependencies.
- π **RAG Knowledgebase**: Retrieve-Augmented Generation (RAG) compatible with multiple vector databases.
- ποΈ **Memory Management**: Ideal for AI-driven applications requiring memory abstraction.
- π **File Support**:
- β
Markdown
- β
Plain Text
- β
PDF
- β³ More formats coming soon!
---
## βοΈ Prerequisites
- **Go** 1.16 or higher
- **Docker** (optional, for containerized deployment)
---
## π§ Quickstart
### π₯ Clone Repository
```sh
git clone https://github.com/mudler/LocalRecall.git
cd LocalRecall
```
### π οΈ Build from Source
```sh
go build -o localrecall
```
### βΆοΈ Run Application
```sh
./localrecall
```
Your web UI will be available at `http://localhost:8080`.
---
## π³ Docker Deployment
Build and run using Docker:
```sh
docker build -t localrecall .
docker run -ti -v $PWD/state:/state \
-e COLLECTION_DB_PATH=/state/db \
-e EMBEDDING_MODEL=granite-embedding-107m-multilingual \
-e FILE_ASSETS=/state/assets \
-e OPENAI_API_KEY=sk-1234567890 \
-e OPENAI_BASE_URL=http://localai:8080 \
-p 8080:8080 localrecall
# Or use the images already built by the CI:
docker run -ti -v $PWD/state:/state \
-e COLLECTION_DB_PATH=/state/db \
-e EMBEDDING_MODEL=granite-embedding-107m-multilingual \
-e FILE_ASSETS=/state/assets \
-e OPENAI_API_KEY=sk-1234567890 \
-e OPENAI_BASE_URL=http://localai:8080 \
-p 8080:8080 quay.io/mudler/localrecall
```
or with Docker compose
```sh
docker compose up -d
```
---
## π Environment Variables
LocalRecall uses environment variables to configure its behavior. These variables allow you to customize paths, models, and integration settings without modifying the code.
| Variable | Description |
| -------------------- | --------------------------------------------------------------------------------------------------------------- |
| `COLLECTION_DB_PATH` | Path to the vector database directory where collections are stored. |
| `EMBEDDING_MODEL` | Name of the embedding model used for vectorization (e.g., `granite-embedding-107m-multilingual`). |
| `FILE_ASSETS` | Directory path to store and retrieve uploaded file assets. |
| `OPENAI_API_KEY` | API key for embedding services (such as LocalAI or OpenAI-compatible APIs). |
| `OPENAI_BASE_URL` | Base URL for the embedding model API (commonly `http://localai:8080`). |
| `LISTENING_ADDRESS` | Address the server listens on (default: `:8080`). Useful for deployments on custom ports or network interfaces. |
| `VECTOR_ENGINE` | Vector database engine to use (`chromem` by default; support for others like Milvus and Qdrant planned). |
| `MAX_CHUNKING_SIZE` | Maximum size (in characters) for breaking down documents into chunks. Affects performance and accuracy. |
| `API_KEYS` | Comma-separated list of API keys for securing access to the REST API (optional). |
| `GIT_PRIVATE_KEY` | Base64-encoded SSH private key for accessing private Git repositories (optional). |
These variables can be passed directly when running the binary or inside your Docker container for easy configuration.
You can use an `.env` file to set the variables. The Docker compose file is configured to use an `.env` file in the root of the project if available.
---
## π REST API
**Base URL**: `http://localhost:8080/api`
### π§ Manage Collections
- **Create Collection**:
```sh
curl -X POST $BASE_URL/collections \
-H "Content-Type: application/json" \
-d '{"name":"myCollection"}'
```
- **Upload File**:
```sh
curl -X POST $BASE_URL/collections/myCollection/upload \
-F "file=@/path/to/file.txt"
```
- **List Collections**:
```sh
curl -X GET $BASE_URL/collections
```
- **List Files in Collection**:
```sh
curl -X GET $BASE_URL/collections/myCollection/entries
```
- **Search Collection**:
```sh
curl -X POST $BASE_URL/collections/myCollection/search \
-H "Content-Type: application/json" \
-d '{"query":"search term", "max_results":5}'
```
- **Reset Collection**:
```sh
curl -X POST $BASE_URL/collections/myCollection/reset
```
- **Delete Entry**:
```sh
curl -X DELETE $BASE_URL/collections/myCollection/entry/delete \
-H "Content-Type: application/json" \
-d '{"entry":"file.txt"}'
```
- **Add External Source**:
```sh
curl -X POST $BASE_URL/collections/myCollection/sources \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com", "update_interval":30}'
```
The `update_interval` is specified in minutes. If not provided, it defaults to 60 minutes.
External sources support various URL types:
- Web pages (https://example.com)
- Git repositories (https://github.com/user/repo.git or
[email protected]:user/repo.git)
- Sitemaps (https://example.com/sitemap.xml)
For private Git repositories, set the `GIT_PRIVATE_KEY` environment variable with a base64-encoded SSH private key:
```sh
# Encode your private key
export GIT_PRIVATE_KEY=$(cat /path/to/private_key | base64 -w 0)
```
- **Remove External Source**:
```sh
curl -X DELETE $BASE_URL/collections/myCollection/sources \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'
```
External sources are automatically monitored and updated in the background. The content is periodically fetched and added to the collection, making it searchable through the regular search endpoint.
---
## π License
Released under the [MIT License](LICENSE).
---
## π€ Contributing
We welcome contributions! Please feel free to:
- β
Open an issue for suggestions or bugs.
- β
Submit a pull request with enhancements.
", Assign "at most 3 tags" to the expected json: {"id":"14326","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"