Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ OPENAI_QUERY_MODEL='gpt-4o'

# use this incase you are prefering to experiment with local models.
OLLAMA_BASE_URL='http://localhost:11434'
OLLAMA_LLM_MODEL='llama3.1'
OLLAMA_LLM_MODEL='llama3.2:latest'
OLLAMA_EMBED_MODEL='nomic-embed-text:latest'

# Langfuse Observability Details
LANGFUSE_PUBLIC_KEY='pk-lf-'
LANGFUSE_SECRET_KEY='sk-lf-'
LANGFUSE_HOST='http://localhost:3000'

# logger can be controlled usiing env
CRITICAL = 50
FATAL = 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@
from llama_index.core.tools import QueryEngineTool, ToolMetadata
from llama_index.core.agent import ReActAgent
from llama_index.vector_stores.qdrant import QdrantVectorStore
from langfuse.llama_index import LlamaIndexInstrumentor
from rag_evaluator import RAGEvaluator
from dotenv import load_dotenv, find_dotenv
import qdrant_client
import logging
import phoenix as px
import llama_index

# instrumenting observability
session = px.launch_app()
llama_index.core.set_global_handler("arize_phoenix")
instrumentor = LlamaIndexInstrumentor()
instrumentor.start()


class ControllableAgentsWithHumanInLoop:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.8'

services:
postgres:
image: postgres:13
container_name: postgres
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin@123
POSTGRES_DB: langfuse
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- langfuse-network

langfuse:
image: langfuse/langfuse:latest
container_name: langfuse
environment:
DATABASE_URL: postgresql://hello:mysecretpassword@postgres:5432/langfuse
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: mysecret
SALT: mysalt
ENCRYPTION_KEY: 98637d42c277ef10b8a324e25d492daa8eee8f769574124ba25132f71481f183
ports:
- "3000:3000"
depends_on:
- postgres
networks:
- langfuse-network

volumes:
postgres_data:

networks:
langfuse-network:
driver: bridge
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Instructions to run the code

#### How to spin observability
- run `docker compose -f docker-compose-langfuse.yml up`
- launch langfuse in browser `http://localhost:3000`
- click on `signup`
- create `organization` & `project`
- once done create your `public` and `private` api keys

#### Running the project
- Navigate to the root of the project and run the below command
- `pip install -r requirements.txt`
- open `.env` file update your qdrant password in the property `DB_API_KEY`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
python-dotenv==1.0.1
llama-index==0.11.16
llama-index-llms-openai==0.2.11
llama-index-llms-ollama==0.3.3
llama-index==0.11.19
llama-index-llms-openai==0.2.16
llama-index-llms-ollama==0.3.4
llama-index-embeddings-openai==0.2.5
llama-index-embeddings-ollama==0.3.1
llama-index-vector-stores-qdrant==0.3.0
llama-index-callbacks-arize-phoenix==0.2.1
arize-phoenix==4.33.1
qdrant-client==1.11.3
llama-index-vector-stores-qdrant==0.3.2
qdrant-client==1.12.0
pydantic==2.9.2
deepeval==1.3.4
deepeval==1.4.4
# observability
langfuse==2.52.2
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
DB_URL='http://localhost:6333'
DB_API_KEY=''
COLLECTION_NAME='YOUR_COLLECTION'
DB_API_KEY='th3s3cr3tk3y'
COLLECTION_NAME='HYDE_COLLECTION'

OPENAI_API_KEY=''
OPENAI_EMBED_MODEL=''

# use this incase you are prefering to experiment with local models.
OLLAMA_BASE_URL='http://localhost:11434'
OLLAMA_LLM_MODEL='llama3.1'
OLLAMA_LLM_MODEL='llama3.2:latest'
OLLAMA_EMBED_MODEL='nomic-embed-text:latest'

# Langfuse Observability Details
LANGFUSE_PUBLIC_KEY='pk-lf-'
LANGFUSE_SECRET_KEY='sk-lf-'
LANGFUSE_HOST='http://localhost:3000'

# logger can be controlled usiing env
CRITICAL = 50
FATAL = 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@
from llama_index.core.retrievers import VectorIndexRetriever
from llama_index.core.indices.query.query_transform import HyDEQueryTransform
from llama_index.core.base.response.schema import Response, StreamingResponse, AsyncStreamingResponse, PydanticResponse
from langfuse.llama_index import LlamaIndexInstrumentor
from rag_evaluator import RAGEvaluator
import qdrant_client
import logging
from dotenv import load_dotenv, find_dotenv
from typing import Union
import phoenix as px
import llama_index

_ = load_dotenv(find_dotenv())

logging.basicConfig(level=int(os.environ['INFO']))
logger = logging.getLogger(__name__)

# instrumenting observability
session = px.launch_app()
llama_index.core.set_global_handler("arize_phoenix")
instrumentor = LlamaIndexInstrumentor()
instrumentor.start()


class BaseRAG:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.8'

services:
postgres:
image: postgres:13
container_name: postgres
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin@123
POSTGRES_DB: langfuse
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- langfuse-network

langfuse:
image: langfuse/langfuse:latest
container_name: langfuse
environment:
DATABASE_URL: postgresql://hello:mysecretpassword@postgres:5432/langfuse
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: mysecret
SALT: mysalt
ENCRYPTION_KEY: 98637d42c277ef10b8a324e25d492daa8eee8f769574124ba25132f71481f183
ports:
- "3000:3000"
depends_on:
- postgres
networks:
- langfuse-network

volumes:
postgres_data:

networks:
langfuse-network:
driver: bridge
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Instructions to run the code

#### How to spin observability
- run `docker compose -f docker-compose-langfuse.yml up`
- launch langfuse in browser `http://localhost:3000`
- click on `signup`
- create `organization` & `project`
- once done create your `public` and `private` api keys

- Navigate to the root of the project and run the below command
- `pip install -r requirements.txt`
- open `.env` file update your qdrant password in the property `DB_API_KEY`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
qdrant-client==1.11.1
python-dotenv==1.0.1
arize-phoenix==4.33.1
llama-index==0.11.7
llama-index-llms-openai==0.2.3
llama-index-llms-ollama==0.3.1
llama-index-embeddings-openai==0.2.4
llama-index-embeddings-ollama==0.3.0
llama-index-vector-stores-qdrant==0.3.0
llama-index-callbacks-arize-phoenix==0.2.1
pydantic==2.9.0
litserve==0.2.2
deepeval==1.3.2
qdrant-client==1.12.0
llama-index==0.11.19
llama-index-llms-openai==0.2.16
llama-index-llms-ollama==0.3.4
llama-index-embeddings-openai==0.2.5
llama-index-embeddings-ollama==0.3.1
llama-index-vector-stores-qdrant==0.3.2
pydantic==2.9.2
litserve==0.2.3
deepeval==1.4.4
# observability
langfuse==2.52.2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DB_URL='http://localhost:6333'
DB_API_KEY='th3s3cr3tk3y'
COLLECTION_NAME='YOUR_COLLECTION'
COLLECTION_NAME='REACT_COLLECTION'

OPENAI_API_KEY=''
OPENAI_EMBED_MODEL=''
Expand All @@ -11,8 +11,8 @@ OLLAMA_LLM_MODEL='llama3.1'
OLLAMA_EMBED_MODEL='nomic-embed-text:latest'

# Langfuse Observability Details
LANGFUSE_PUBLIC_KEY='pk-lf-437340f3-3b53-4dd6-9603-b63ac69babc5'
LANGFUSE_SECRET_KEY='sk-lf-c5fce8a2-7fd8-4a21-a314-10d519460333'
LANGFUSE_PUBLIC_KEY='pk-lf-'
LANGFUSE_SECRET_KEY='sk-lf-'
LANGFUSE_HOST='http://localhost:3000'

# logger can be controlled usiing env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ OLLAMA_BASE_URL='http://localhost:11434'
OLLAMA_LLM_MODEL='llama3.1'
OLLAMA_EMBED_MODEL='nomic-embed-text:latest'

# Langfuse Observability Details
LANGFUSE_PUBLIC_KEY='pk-lf-'
LANGFUSE_SECRET_KEY='sk-lf-'
LANGFUSE_HOST='http://localhost:3000'

# logger can be controlled usiing env
CRITICAL = 50
FATAL = 50
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3.8'

services:
postgres:
image: postgres:13
container_name: postgres
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin@123
POSTGRES_DB: langfuse
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- langfuse-network

langfuse:
image: langfuse/langfuse:latest
container_name: langfuse
environment:
DATABASE_URL: postgresql://hello:mysecretpassword@postgres:5432/langfuse
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: mysecret
SALT: mysalt
ENCRYPTION_KEY: 98637d42c277ef10b8a324e25d492daa8eee8f769574124ba25132f71481f183
ports:
- "3000:3000"
depends_on:
- postgres
networks:
- langfuse-network

volumes:
postgres_data:

networks:
langfuse-network:
driver: bridge
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Instructions to run the code

## Self-Correcting RAG
#### How to spin observability
- run `docker compose -f docker-compose-langfuse.yml up`
- launch langfuse in browser `http://localhost:3000`
- click on `signup`
- create `organization` & `project`
- once done create your `public` and `private` api keys
-
#### Instructions to run the code
- Navigate to the root of the project and run the below command
- `pip install -r requirements.txt`
- open `.env` file update your qdrant url `DB_URL` & password `DB_API_KEY`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
python-dotenv==1.0.1
llama-index==0.11.7
llama-index-llms-openai==0.2.3
llama-index-llms-ollama==0.3.1
llama-index-embeddings-openai==0.2.4
llama-index-embeddings-ollama==0.3.0
llama-index-vector-stores-qdrant==0.3.0
llama-index-callbacks-arize-phoenix==0.2.1
qdrant-client==1.11.1
pydantic==2.9.0
arize-phoenix==4.33.1
litserve==0.2.2
deepeval==1.3.2
llama-index==0.11.19
llama-index-llms-openai==0.2.16
llama-index-llms-ollama==0.3.4
llama-index-embeddings-openai==0.2.5
llama-index-embeddings-ollama==0.3.1
llama-index-vector-stores-qdrant==0.3.2
qdrant-client==1.12.0
pydantic==2.9.2
litserve==0.2.3
deepeval==1.4.4
# observability
langfuse==2.52.2
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
from llama_index.core.query_engine import RetryQueryEngine, RetrySourceQueryEngine, RetryGuidelineQueryEngine
from llama_index.core.evaluation import RelevancyEvaluator, GuidelineEvaluator
from llama_index.core.evaluation.guideline import DEFAULT_GUIDELINES
from langfuse.llama_index import LlamaIndexInstrumentor
from rag_evaluator import RAGEvaluator
from dotenv import load_dotenv, find_dotenv
from typing import Union
import qdrant_client
import llama_index
import phoenix as px
import logging
import os

Expand All @@ -27,8 +26,8 @@
logger = logging.getLogger(__name__)

# instrumenting observability
session = px.launch_app()
llama_index.core.set_global_handler("arize_phoenix")
instrumentor = LlamaIndexInstrumentor()
instrumentor.start()


class SelfCorrectingRAG:
Expand Down
4 changes: 2 additions & 2 deletions bootstraprag/templates/qdrant/simple_search/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DB_URL='http://localhost:6333'
DB_API_KEY=''
COLLECTION_NAME='YOUR_COLLECTION'
DB_API_KEY='th3s3cr3tk3y'
COLLECTION_NAME='SIMPLE_SEARCH_COLLECTION'
DENSE_MODEL='sentence-transformers/all-MiniLM-L6-v2'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
qdrant-client==1.11.3
qdrant-client==1.12.0
python-dotenv==1.0.1