> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useskald.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge spaces and filters

> How to separate knowledge in Skald and filter information sources on retrieval

In Skald, you can create multiple projects to keep data segregated. This is useful when you use Skald for different applications, or when you have a staging and a prod environment, for example.

However, inside the same project, there are various use cases where you'd want to be able to filter what information sources are used for a given query, such as when you're using Skald to provide insights scoped to each one of your users.

In that case, you should use our filtering capabilities.

When creating a memo, there are various optional fields that you can provide that will be attached to the memo, such as `source`, `reference_id`, `tags`, and `metadata`.

All of these fields can then be used as filters when using our retrieval APIs, such that search results and chat responses will only query the memos that match the filters.

These fields (including all the metadata fields you provide) are indexed so not only will adding filters not affect retrieval performance, it will actually make it faster, by giving our system less context to process.

We recommend using `reference_id` to match a memo to an ID in your own system (e.g. a document ID) but other fields can be used for you to create knowledge spaces.

For instance, you can use `user_id:12345` as `source` or set `user_id = 12345` as a metadata field.

When filtering, you would then use a filter like this:

```json theme={null}
{
    "field": "source",
    "operator": "eq",
    "value": "user_id:12345",
    "filter_type": "native_field"
}
```

Or this:

```json theme={null}
{
    "field": "user_id",
    "operator": "eq",
    "value": "12345",
    "filter_type": "custom_metadata"
}
```

These filters will **ensure no context other than what matches the filter will be used to process query**.

If you have any questions or feedback about filtering, don't hesistate to reach out to `dev@useskald.com`.
