Skip to content

Commit 7991873

Browse files
Merge pull request #36 from weaviate/release/v0.2.x
2 parents ce99edd + f5fc4be commit 7991873

34 files changed

+773
-79
lines changed

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# WCD_URL=
22
# WCD_API_KEY=
33

4+
#WEAVIATE_IS_LOCAL
5+
#LOCAL_WEAVIATE_PORT
6+
#LOCAL_WEAVIATE_GRPC_PORT
7+
48
# OPENROUTER_API_KEY=
59

610
# ANTHROPIC_API_KEY=

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ Done! You can now use the Elysia python package
101101

102102
### Configuring Settings
103103

104-
To use Elysia with Weaviate, i.e. for agentic searching and retrieval, you need a Weaviate cluster api key and URL. This can be specific in the app directly, or by creating a `.env` file with
104+
To use Elysia with Weaviate, i.e. for agentic searching and retrieval, you need to either have a *locally running* instance of Weaviate, or access to a *Weaviate cloud cluster* via an api key and URL. This can be specific in the app directly, or by creating a `.env` file with
105105
```
106106
WCD_URL=...
107107
WCD_API_KEY=...
108+
WEAVIATE_IS_LOCAL=... # True or False
108109
```
109110
Elysia will automatically detect these when running locally, and this will be the default Weaviate cluster for all users logging into the Elysia app. But these can be configured on a user-by-user basis through the config.
110111

@@ -181,3 +182,13 @@ There are no 'huge' new features we are planning for Elysia (for the moment). Yo
181182

182183
</details>
183184

185+
186+
<details>
187+
<summary><b>Can I run Elysia completely locally? (Locally running Weaviate, local models)</b></summary>
188+
189+
Yes!
190+
191+
You can connect to a locally running Weaviate instance in Docker, and connect to Ollama for locally running language models.
192+
[See the setup page to get started.](https://weaviate.github.io/elysia/setting_up/)
193+
194+
</details>

docs/Examples/query_weaviate.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,31 @@ This example will walk through using Elysia to:
1111

1212
Before setting up your environment and connecting to Weaviate, make sure you have the necessary API keys and access credentials for both your language models and your Weaviate instance. This will ensure a smooth setup process in the following steps.
1313

14-
1. [You should have a Weaviate cloud cluster - see Step 1.1 in the Weaviate quickstart guide.](https://docs.weaviate.io/weaviate/quickstart#step-1-set-up-weaviate)
15-
2. [You need to find your REST endpoint URL and Admin API key for your cluster - see Step 1.3 in the Weaviate quickstart guide](https://docs.weaviate.io/weaviate/quickstart#13-connect-to-weaviate)
16-
3. You additionally need API keys for any LLMs you want to use. We recommend [OpenRouter](https://openrouter.ai/) to gain access to a range of models.
14+
1. You should have a Weaviate cloud cluster or locally running Weaviate instance - [see Step 1.1 in the Weaviate quickstart guide for cloud](https://docs.weaviate.io/weaviate/quickstart#step-1-set-up-weaviate) and [see here for running Weaviate locally with Docker](https://docs.weaviate.io/deploy/installation-guides/docker-installation).
15+
2. [You need to find your REST endpoint URL and Admin API key for your cloud cluster - see Step 1.3 in the Weaviate quickstart guide](https://docs.weaviate.io/weaviate/quickstart#13-connect-to-weaviate), or
16+
3. You additionally need API keys for any LLMs you want to use. We recommend [OpenRouter](https://openrouter.ai/) to gain access to a range of models, or [Ollama](https://ollama.com/) for locally running models.
1717

1818
## Setting up
1919

20-
Let's use the basic elysia `configure` to both *set up your models* and *connect to your Weaviate cluster*.
20+
Let's use the basic elysia `configure` to both *set up your models* and *connect to your Weaviate instance*.
2121

2222
```python
2323
from elysia import configure
2424
configure(
25+
weaviate_is_local = False, # replace with True if locally running Weaviate
2526
wcd_url = "...", # replace with your Weaviate REST endpoint URL
2627
wcd_api_key = "..." # replace with your Weaviate cluster API key,
27-
base_model = "gemini-2.0.flash-001",
28-
base_provider = "gemini",
28+
base_model = "gemini-2.0.flash-001", # replace with whichever model you are using
29+
base_provider = "gemini", # replace with your model provider or 'ollama' for locally running ollama models
2930
complex_model = "gemini-2.5.flash-001",
3031
complex_provider = "gemini",
31-
gemini_api_key = "..." # replace with your GEMINI_API_KEY from Google AI studio
32+
gemini_api_key = "..." # replace with your GEMINI_API_KEY from Google AI studio, or whichever API key you need for Weaviate/your LLMs
3233
)
3334
```
3435
Alternatively, you can use different models, such as `gpt-4.1-mini`, `gpt-4.1`, with `base_provider="openai"` and `complex_provider="openai"`, as well as an `openai_api_key`. Or any model/provider combination that you wish, [see the full LiteLLM docs for all API keys and models/providers](https://docs.litellm.ai/docs/providers).
3536

36-
## Optional: Add some data to your Weaviate cluster
3737

38+
## Optional: Add some data to your Weaviate cluster
3839

3940
We're going to create some basic data and an example collection for this demo. This is based on [this example in the Weaviate docs](https://docs.weaviate.io/weaviate/recipes/generative_search_aws_bedrock).
4041

docs/index.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ Unlike other agent-based packages, Elysia is pre-configured to run a wide range
4646

4747
Or you could customise Elysia to your liking, create your own custom tools and add them to the Elysia decision tree.
4848

49-
To use Elysia to search your data, you need a Weaviate cluster (or you can define your own custom tool to search another data source!).
49+
To use Elysia to search your data, you need to either have [a Weaviate cloud cluster or a locally running Weaviate instance](setting_up.md#weaviate-integration) (or you can define your own custom tool to search another data source!).
5050

51-
[Sign up to Weaviate! A 14 day sandbox cluster is free.](https://weaviate.io/deployment/serverless)
51+
[Sign up to Weaviate Cloud! A 14 day sandbox cluster is free.](https://weaviate.io/deployment/serverless)
5252

53-
For more information on signing up to Weaviate, [click here](https://weaviate.io/developers/wcs/platform/create-account).
53+
For more information on signing up to Weaviate Cloud, [click here](https://weaviate.io/developers/wcs/platform/create-account).
5454

55-
From your weaviate cluster, you can upload data via a CSV on the cloud console, or [you can upload via the Weaviate APIs](https://weaviate.io/developers/academy/py/zero_to_mvp/schema_and_imports/import).
55+
From your Weaviate cloud cluster, you can upload data via a CSV on the cloud console, or [you can upload via the Weaviate APIs](https://weaviate.io/developers/academy/py/zero_to_mvp/schema_and_imports/import).
5656

5757
## About
5858

@@ -64,7 +64,6 @@ Check out the Github Repositories for the backend and the frontend
6464

6565
Elysia was developed by Edward Schmuhl (frontend) and Danny Williams (backend). Check out our socials below:
6666

67-
6867
- [Edward's Linkedin](https://www.linkedin.com/in/edwardschmuhl/)
6968

7069
- [Danny's Linkedin](https://www.linkedin.com/in/dannyjameswilliams/)

docs/setting_up.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,22 @@ configure(
6666

6767
On the app side, this is configurable via the 'Api Base URL' parameter in the Settings. Set both of your providers to `ollama`, and your base and complex model to whatever model you are currently hosting, and this should work out-of-the-box.
6868

69-
Warning: Elysia uses a *long context*, quite long context, due to the nature of the collection schemas, environment and more being included in every prompt. So these models will run quite slowly. However, on the backend, you can configure this to be faster by disabling connection to your Weaviate cluster, if applicable, by removing your weaviate api key and url. Also, there is an optional setting
69+
**Warning**: Elysia uses a *long context*, quite long context, due to the nature of the collection schemas, environment and more being included in every prompt. So these models will run quite slowly. However, on the backend, you can configure this to be faster by disabling connection to your Weaviate cluster, if applicable, by removing your weaviate api key and url. There is an optional setting
7070
```python
7171
settings.configure(
7272
base_use_reasoning=False,
7373
complex_use_reasoning=False
7474
)
7575
```
76-
which will remove chain of thought prompting for the base and complex model, respectively. Use this with caution though, as it will degrade accuracy significantly. Additionally, some smaller models struggle with the complex nature of multiple outputs in DSPy and Elysia, so you might encounter some errors. In testing, the `gpt-oss` models work relatively well.
76+
which will remove chain of thought prompting for the base and complex model, respectively. *Use this with caution though*, as it will degrade accuracy significantly. Additionally, some smaller models struggle with the complex nature of multiple outputs in DSPy and Elysia, so you might encounter some errors. In testing, the `gpt-oss` models work relatively well.
77+
78+
*Note: Simplifying model outputs and reducing the context window size for local models is planned for a future version of Elysia. Stay tuned!*
7779

7880
## Weaviate Integration
7981

80-
To use Elysia with Weaviate, you need to specify your Weaviate cluster details. These can be set via the Weaviate Cluster URL (`WCD_URL`) and the Weaviate Cluster API Key (`WCD_API_KEY`). To set these values, you can use `configure` on the settings:
82+
### Weaviate Cloud
83+
84+
To use Elysia with Weaviate cloud, you need to specify your Weaviate cluster details. These can be set via the Weaviate Cluster URL (`WCD_URL`) and the Weaviate Cluster API Key (`WCD_API_KEY`). To set these values, you can use `configure` on the settings:
8185
```python
8286
from elysia import configure
8387
configure(
@@ -91,9 +95,46 @@ WCD_URL=... # replace with your WCD_URL
9195
WCD_API_KEY=... # replace with your WCD_API_KEY
9296
```
9397

98+
[You can sign up for a 14-day sandbox to Weaviate cloud for free.](https://weaviate.io/deployment/serverless)
99+
100+
### Local Weaviate
101+
102+
You can run Elysia with a locally running Weaviate (e.g. Docker), making Elysia able to be run with *completely open source* software. To do so, you only need to set your local Weaviate instance variables. Configure Elysia to use the local instance by setting in the `.env` file:
103+
104+
```
105+
WEAVIATE_IS_LOCAL=True
106+
107+
# URL can be just a host or full URL; defaults shown below
108+
WCD_URL=localhost # or http://localhost:8080
109+
LOCAL_WEAVIATE_PORT=8080 # optional override
110+
LOCAL_WEAVIATE_GRPC_PORT=50051 # optional override
111+
112+
# No API key required for local unless you enabled local auth
113+
WCD_API_KEY=
114+
```
115+
116+
Or within Python via:
117+
118+
```python
119+
from elysia import configure
120+
configure(
121+
weaviate_is_local=True,
122+
wcd_url="http://localhost:8080", # or "localhost"
123+
local_weaviate_port=8080,
124+
local_weaviate_grpc_port=50051,
125+
)
126+
```
127+
128+
Notes:
129+
- If `WEAVIATE_IS_LOCAL=True` and no URL is provided, Elysia defaults to `localhost` with ports shown above.
130+
- Local mode can work without an API key; if you enable auth locally, set `WCD_API_KEY` accordingly.
131+
132+
The easiest way to set up a local Weaviate instance is via Docker, [see here for detailed instructions.](https://docs.weaviate.io/deploy/installation-guides/docker-installation)
133+
94134
Additionally, you need to _preprocess_ your collections for Elysia to use the built in Weaviate-based tools, see below for details.
95135

96-
*Note: using a local Weaviate instance is currently not supported. This is coming soon! [You can sign up for a 14-day sandbox for free.](https://weaviate.io/deployment/serverless)
136+
*Note: Using a local Weaviate instance is experimental. If you run into any issues, please open a [Github Issue](https://github.com/weaviate/elysia/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)!*
137+
97138

98139
## Preprocessing Collections
99140

elysia/api/routes/user_config.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,16 @@ async def load_a_config(
145145
user = await user_manager.get_user_local(user_id)
146146
frontend_config = user["frontend_config"]
147147

148-
# check if the user has a valid save location
149-
if (
150-
frontend_config.save_location_wcd_url == ""
151-
or frontend_config.save_location_wcd_api_key == ""
148+
# check if the user has a valid save location (allow local without API key)
149+
if frontend_config.save_location_wcd_url == "" or (
150+
frontend_config.save_location_wcd_api_key == ""
151+
and not frontend_config.save_location_weaviate_is_local
152152
):
153153
raise Exception("WCD URL or API key not found.")
154154

155-
if (
156-
frontend_config.save_location_wcd_url == ""
157-
or frontend_config.save_location_wcd_api_key == ""
155+
if frontend_config.save_location_wcd_url == "" or (
156+
frontend_config.save_location_wcd_api_key == ""
157+
and not frontend_config.save_location_weaviate_is_local
158158
):
159159
raise Exception(
160160
"No valid destination for config load location found. "
@@ -257,10 +257,6 @@ async def new_user_config(
257257
branch_initialisation="one_branch",
258258
)
259259

260-
frontend_config.save_location_wcd_url = frontend_config.save_location_wcd_url
261-
frontend_config.save_location_wcd_api_key = (
262-
frontend_config.save_location_wcd_api_key
263-
)
264260
frontend_config.config = {
265261
"save_trees_to_weaviate": True,
266262
"save_configs_to_weaviate": True,
@@ -445,10 +441,13 @@ async def save_config_user(
445441
end_goal = user["tree_manager"].config.end_goal
446442
branch_initialisation = user["tree_manager"].config.branch_initialisation
447443

448-
# Check if the user has a valid save location
449-
if (
450-
user["frontend_config"].save_location_wcd_url == ""
451-
or user["frontend_config"].save_location_wcd_api_key == ""
444+
# Do not override frontend storage settings with backend settings here;
445+
# storage cluster for configs/conversations is controlled via frontend payload
446+
447+
# Check if the user has a valid save location (allow local without API key)
448+
if user["frontend_config"].save_location_wcd_url == "" or (
449+
user["frontend_config"].save_location_wcd_api_key == ""
450+
and not user["frontend_config"].save_location_weaviate_is_local
452451
):
453452
warnings.append(
454453
"No valid destination for config save location found. "
@@ -776,9 +775,11 @@ async def list_configs(
776775
or "save_location_wcd_url" not in user["frontend_config"].__dict__
777776
or "save_location_wcd_api_key" not in user["frontend_config"].__dict__
778777
or user["frontend_config"].save_location_wcd_url is None
779-
or user["frontend_config"].save_location_wcd_api_key is None
780778
or user["frontend_config"].save_location_wcd_url == ""
781-
or user["frontend_config"].save_location_wcd_api_key == ""
779+
or (
780+
user["frontend_config"].save_location_wcd_api_key in [None, ""]
781+
and not user["frontend_config"].save_location_weaviate_is_local
782+
)
782783
):
783784
logger.warning(
784785
"In /list_configs API, "

elysia/api/services/user.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ async def update_config(
129129
wcd_url=local_user["tree_manager"].settings.WCD_URL,
130130
wcd_api_key=local_user["tree_manager"].settings.WCD_API_KEY,
131131
api_keys=local_user["tree_manager"].settings.API_KEYS,
132+
weaviate_is_local=local_user["tree_manager"].settings.WEAVIATE_IS_LOCAL,
133+
local_weaviate_port=local_user["tree_manager"].settings.LOCAL_WEAVIATE_PORT,
134+
local_weaviate_grpc_port=local_user["tree_manager"].settings.LOCAL_WEAVIATE_GRPC_PORT,
132135
)
133136

134137
async def update_frontend_config(

elysia/api/static/404.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)