> For the complete documentation index, see [llms.txt](https://docs.searchcitrus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.searchcitrus.com/quick-start/using-citrus-with-postgres.md).

# Using citrus with Postgres

A lot of vector database solutions typically store vectors and other metadata on their own platform. While citrus supports the same, we also make it possible for developers to have full access to their data. This starts with enabling support for Postgres as a database layer with citrus.

If your application is already using a Postgres database, integrating citrus is easy! citrus manages an efficient vector index while storing all the relevant data on your pre-existing database.

## How to get started

{% hint style="warning" %}
Postgres integration is still in beta. Please open issues on [GitHub](https://github.com/0xDebabrata/citrus) if you encounter any bugs!
{% endhint %}

We like to keep things simple. So all you need to do to enable Postgres support, is instantiate citrus in the following manner.

```python
client = citrusdb.Client(
    persist_directory="citrus",
    database_type="pg",
    host=PG_HOST,
    port=PG_PORT,
    user=PG_USER,
    password=PG_PASSWORD
)
```

Every other interaction with the client remains entirely the same! If you're looking to create new indices, insert new vectors or perform semantic search, head over to [quick start](/quick-start.md)

## Code examples

We're currently pushing hard to release some cool new projects that showcase citrus and also help teach others how to best make use of citrus. If you have any questions, please send us a DM on [Twitter](https://twitter.com/0xDebabrata)!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.searchcitrus.com/quick-start/using-citrus-with-postgres.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
