Docs /Templates/ sinapsis-llama-index

LLaMAIndexInsertNodes

sinapsis-llama-indexLlamaIndexdatabaseembeddingsllamaindexpostgresql

Python template · sinapsis_llama_index.templates.llama_index_insert_nodes

Overview

Insert embedded `TextNode` objects into a PostgreSQL `PGVectorStore`.

This template reads nodes from `container.generic_data[input_nodes_key]` and inserts them into the configured PGVector table. The vector dimension is inferred lazily from the first valid node embedding, so it does not need to be configured manually.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-llama-index==1.0.0
uv pip install sinapsis-llama-index==1.0.0
uv add sinapsis-llama-index==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
db_config

Configuration for connecting to the PostgreSQL database, handling credentials via environment variables if needed.

VectorStoreDBConfig
Optional
Default: null
host

Database host address (hostname or IP). Loaded from PGVECTOR_HOST if not provided. Defaults to `"localhost"`.

str
Optional
Default: "localhost"
port

Database port number. Loaded from PGVECTOR_PORT if not provided. Defaults to `5432`.

int
Optional
Default: 5432
user

Database user name. Loaded from PGVECTOR_USER if not provided. Defaults to `None`.

str | None
Optional
Default: null
db_name

Name of the specific database to connect to. Defaults to `"sinapsis_db"`.

str
Optional
Default: "sinapsis_db"
password

Database password. Loaded from PGVECTOR_PASSWORD if not provided. Defaults to `None`.

str | None
Optional
Default: null
provider

Database provider. Supabase uses the existing database and SSL. Defaults to `"postgres"`.

typing.Literal['postgres', 'supabase']
Optional
Default: "postgres"
table_name

Name of the table within the database containing the vectors. Defaults to `"sinapsis_table"`.

str
Optional
Default: "sinapsis_table"
input_nodes_keyRequired

Key used to access the nodes to insert into the store.

str
Required
Default: null

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: LLaMAIndexInsertNodes
  class_name: LLaMAIndexInsertNodes
  template_input: InputTemplate
  attributes:
    db_config:
      user: my_user
      password: my_password
      port: 5432
      host: localhost
      db_name: my_db
      table_name: my_embeddings
    input_nodes_key: EmbeddingNodeGenerator
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "LLaMAIndexInsertNodes"
    class_name: "LLaMAIndexInsertNodes"
    attributes:
      db_config:
        host: "localhost"
        port: 5432
        user: null
        db_name: "sinapsis_db"
        password: null
        provider: "postgres"
        table_name: "sinapsis_table"
      input_nodes_key: "<required>"

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.