Skip to main content



Sinapsis LlamaIndex

Sinapsis templates for LlamaIndex ingestion, retrieval, reranking, and semantic caching.

🐍 Installation • 🚀 Features • 📚 Usage example • 📙 Documentation • 🔍 License

The sinapsis-llama-index package provides ingestion, retrieval, reranking, and semantic caching templates built on top of LlamaIndex. It is designed to work with Sinapsis packet flows, including plain TextPacket retrieval and LLMConversationPacket.contexts for downstream LLM templates.

🐍 Installation

Install using your package manager of choice. We encourage the use of uv.

Example with uv:

uv pip install sinapsis-llama-index --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

pip install sinapsis-llama-index --extra-index-url https://pypi.sinapsis.tech

🚀 Features

Templates Supported

  • EmbeddingNodeGenerator: Split text documents into chunks and generate embedded TextNode objects.
  • CodeEmbeddingNodeGenerator: Split source-code repositories with CodeSplitter and embed the resulting nodes.
  • LLaMAIndexInsertNodes: Insert embedded nodes into PostgreSQL PGVectorStore tables.
  • LLaMAIndexNodeRetriever: Retrieve nodes from PGVector for both TextPacket and LLMConversationPacket inputs.
  • LLaMAIndexReranker: Rerank selected LLMConversationPacket.contexts categories with SentenceTransformerRerank.
  • LLaMAIndexSemanticCacheLookup: Reuse cached LLM responses from PGVector when a semantically similar prompt is found under the same request scope.
  • LLaMAIndexSemanticCacheWrite: Persist completed LLM responses into a PGVector-backed semantic cache for future reuse.
  • LLaMAIndexClearTable: Clear all rows from a PGVector table while keeping its schema.
  • LLaMAIndexDeleteTable: Drop a PGVector table and remove all stored vectors.

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis Chatbots Base.

📚 Usage example

The following configuration assumes a PGVector table is already populated and shows a typical retrieval pipeline: create an LLMConversationPacket, retrieve candidate contexts from PGVector, and rerank them before a downstream LLM template consumes the results.

Config
agent:
  name: reranker_demo
  description: Retrieve and rerank help-center contexts before they are consumed by an LLM.

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: LLMConversationInput
    class_name: LLMConversationInput
    template_input: InputTemplate
    attributes:
      prompt: "How long does the password reset link remain valid?"
      system_prompt: "Use the best retrieved context."

  - template_name: LLaMAIndexNodeRetriever
    class_name: LLaMAIndexNodeRetriever
    template_input: LLMConversationInput
    attributes:
      embedding_config:
        model_name: Snowflake/snowflake-arctic-embed-xs
        embed_batch_size: 10
        device: cpu
        trust_remote_code: true
      db_config:
        user: myuser
        password: mypass
        port: 5432
        host: localhost
        db_name: sinapsis_db
        table_name: sinapsis_data
      retrieve_args:
        query_mode: default
        similarity_top_k: 8
        threshold: 0.3

  - template_name: LLaMAIndexReranker
    class_name: LLaMAIndexReranker
    template_input: LLaMAIndexNodeRetriever
    attributes:
      rerank_config:
        model: cross-encoder/stsb-distilroberta-base
        top_n: 2
        device: cpu
        keep_retrieval_score: false
        trust_remote_code: true
      rerank_categories:
        - rag

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Metadata

Release files for sinapsis-llama-index 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinapsis-llama-index 0.3.2
File Size Uploaded
sinapsis_llama_index-0.3.2.tar.gz 39.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis-llama-index 0.3.2
File Interpreter ABI Platform
sinapsis_llama_index-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 89.5 kB

Release files / sinapsis_llama_index-0.3.2.tar.gz

Download URL sinapsis_llama_index-0.3.2.tar.gz
Size 39.4 kB
Tags Source
SHA-256 checksum
How to use checksums
344b81fc6f272f368fcae2b0e8a017cc429ef509e09935f0accab64fc3863b2f
BLAKE2b-256 checksum
How to use checksums
56f8d830b0c1d9fb7721dc8c026cc3358f59ec7c59b2c63f883daed7937cf5e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release files / sinapsis_llama_index-0.3.2-py3-none-any.whl

Download URL sinapsis_llama_index-0.3.2-py3-none-any.whl
Size 50.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a59ae640a398cd6cecfa50cbf7fa67f21a4f7dc8be3df258ea373ed8400b32c
BLAKE2b-256 checksum
How to use checksums
b50ccd08211a9c774cf71891ab551e428dcbdbfbe82f9d31ce2264e9a204f6d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page