Skip to content

Commit 70de23e

Browse files
authored
feat: configurable embedding dimensions + OpenAI Embeddings (#101)
* feat: configurable embedding dimensions + OpenAI Embeddings * fix tests
1 parent 1984936 commit 70de23e

12 files changed

Lines changed: 935 additions & 38 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Bug Report
2+
description: Report a bug or unexpected behavior
3+
labels: ["bug", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to report a bug! Please fill out the sections below.
9+
10+
- type: textarea
11+
id: description
12+
attributes:
13+
label: Bug Description
14+
description: A clear and concise description of the bug
15+
placeholder: What happened?
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: reproduction
21+
attributes:
22+
label: Steps to Reproduce
23+
description: Steps to reproduce the behavior
24+
placeholder: |
25+
1. Configure '...'
26+
2. Call '...'
27+
3. See error
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: expected
33+
attributes:
34+
label: Expected Behavior
35+
description: What did you expect to happen?
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: actual
41+
attributes:
42+
label: Actual Behavior
43+
description: What actually happened?
44+
validations:
45+
required: true
46+
47+
- type: input
48+
id: version
49+
attributes:
50+
label: Version
51+
description: What version are you using?
52+
placeholder: e.g., 0.1.0 or commit hash
53+
validations:
54+
required: false
55+
56+
- type: dropdown
57+
id: llm-provider
58+
attributes:
59+
label: LLM Provider
60+
description: Which LLM provider are you using?
61+
options:
62+
- OpenAI
63+
- Anthropic
64+
- Gemini
65+
- Groq
66+
- Ollama
67+
- LM Studio
68+
- Other
69+
validations:
70+
required: false
71+

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions & Help
4+
url: https://github.com/vectorize-io/hindsight/discussions/categories/q-a
5+
about: Please ask questions and get help in Discussions instead of opening an issue.
6+
- name: Ideas & Feedback
7+
url: https://github.com/vectorize-io/hindsight/discussions/categories/ideas
8+
about: Share ideas or give feedback in Discussions.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Feature Request
2+
description: Suggest a new feature or enhancement
3+
labels: ["enhancement", "triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for suggesting a feature! Please describe what you'd like to see added.
9+
10+
- type: textarea
11+
id: use-case
12+
attributes:
13+
label: Use Case
14+
description: Describe your specific use case. What are you building? What's your goal?
15+
placeholder: |
16+
I'm building an AI agent that needs to...
17+
My application handles...
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
id: problem
23+
attributes:
24+
label: Problem Statement
25+
description: What problem are you facing? What's missing or difficult today?
26+
placeholder: Currently I have to... which causes...
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: benefit
32+
attributes:
33+
label: How This Feature Would Help
34+
description: Explain how this feature would improve your workflow or solve your problem
35+
placeholder: With this feature, I would be able to...
36+
validations:
37+
required: true
38+
39+
- type: textarea
40+
id: solution
41+
attributes:
42+
label: Proposed Solution
43+
description: Describe your ideal solution (optional - we may have ideas too!)
44+
placeholder: It would be great if Hindsight could...
45+
validations:
46+
required: false
47+
48+
- type: textarea
49+
id: alternatives
50+
attributes:
51+
label: Alternatives Considered
52+
description: Have you considered any alternative solutions or workarounds?
53+
validations:
54+
required: false
55+
56+
- type: dropdown
57+
id: priority
58+
attributes:
59+
label: Priority
60+
description: How important is this feature to you?
61+
options:
62+
- Nice to have
63+
- Important - affects my workflow
64+
- Critical - blocking my use case
65+
validations:
66+
required: true
67+
68+
- type: textarea
69+
id: additional
70+
attributes:
71+
label: Additional Context
72+
description: Any other context, mockups, or examples?
73+
validations:
74+
required: false
75+
76+
- type: checkboxes
77+
id: checklist
78+
attributes:
79+
label: Checklist
80+
options:
81+
- label: I would be willing to contribute this feature
82+
required: false

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ jobs:
325325
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
326326
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
327327
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
328+
HINDSIGHT_API_EMBEDDINGS_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
328329
HINDSIGHT_API_LLM_MODEL: openai/gpt-oss-20b
329330
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
330331
# Prefer CPU-only PyTorch in CI (but keep PyPI for everything else)

hindsight-api/hindsight_api/config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
ENV_EMBEDDINGS_PROVIDER = "HINDSIGHT_API_EMBEDDINGS_PROVIDER"
2323
ENV_EMBEDDINGS_LOCAL_MODEL = "HINDSIGHT_API_EMBEDDINGS_LOCAL_MODEL"
2424
ENV_EMBEDDINGS_TEI_URL = "HINDSIGHT_API_EMBEDDINGS_TEI_URL"
25+
ENV_EMBEDDINGS_OPENAI_API_KEY = "HINDSIGHT_API_EMBEDDINGS_OPENAI_API_KEY"
26+
ENV_EMBEDDINGS_OPENAI_MODEL = "HINDSIGHT_API_EMBEDDINGS_OPENAI_MODEL"
2527

2628
ENV_RERANKER_PROVIDER = "HINDSIGHT_API_RERANKER_PROVIDER"
2729
ENV_RERANKER_LOCAL_MODEL = "HINDSIGHT_API_RERANKER_LOCAL_MODEL"
@@ -52,6 +54,8 @@
5254

5355
DEFAULT_EMBEDDINGS_PROVIDER = "local"
5456
DEFAULT_EMBEDDINGS_LOCAL_MODEL = "BAAI/bge-small-en-v1.5"
57+
DEFAULT_EMBEDDINGS_OPENAI_MODEL = "text-embedding-3-small"
58+
DEFAULT_EMBEDDING_DIMENSION = 384
5559

5660
DEFAULT_RERANKER_PROVIDER = "local"
5761
DEFAULT_RERANKER_LOCAL_MODEL = "cross-encoder/ms-marco-MiniLM-L-6-v2"
@@ -87,8 +91,8 @@
8791
- Remember user's goals and context
8892
- Personalize responses based on past interactions"""
8993

90-
# Required embedding dimension for database schema
91-
EMBEDDING_DIMENSION = 384
94+
# Default embedding dimension (used by initial migration, adjusted at runtime)
95+
EMBEDDING_DIMENSION = DEFAULT_EMBEDDING_DIMENSION
9296

9397

9498
@dataclass

0 commit comments

Comments
 (0)