Skip to content

Commit d7cb981

Browse files
Merge pull request #87 from wisedev-code/22-agent-knowledge-base
Agent knowledge base feature
2 parents 03098b2 + f08ec24 commit d7cb981

57 files changed

Lines changed: 2742 additions & 77 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Examples/Examples.SimpleConsole/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
var model = AIHub.Model();
99

1010
var m = model.GetModel("gemma3:4b");
11-
1211
var x = model.GetModel("llama3.2:3b");
1312
await model.DownloadAsync(x.Name);
1413

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using Examples.Utils;
2+
using MaIN.Core.Hub;
3+
using MaIN.Core.Hub.Utils;
4+
using MaIN.Domain.Entities.Agents.AgentSource;
5+
using Microsoft.Identity.Client;
6+
7+
namespace Examples.Agents;
8+
9+
public class AgentWithKnowledgeFileExample : IExample
10+
{
11+
public async Task Start()
12+
{
13+
Console.WriteLine("Agent with knowledge base example");
14+
AIHub.Extensions.DisableLLamaLogs();
15+
var context = await AIHub.Agent()
16+
.WithModel("gemma3:4b")
17+
.WithInitialPrompt("""
18+
You are a helpful assistant that answers questions about a company. Try to
19+
help employees find answers to their questions. Company you work for is TechVibe Solutions.
20+
""")
21+
.WithKnowledge(KnowledgeBuilder.Instance
22+
.AddFile("people.md", "./Files/Knowledge/people.md",
23+
tags: ["workers", "employees", "company"])
24+
.AddFile("organization.md", "./Files/Knowledge/organization.md",
25+
tags:["company structure", "company policy", "company culture", "company overview"])
26+
.AddFile("events.md", "./Files/Knowledge/events.md",
27+
tags: ["company events", "company calendar", "company agenda"])
28+
.AddFile("office_layout.md", "./Files/Knowledge/office_layout.md",
29+
tags: ["company layout", "company facilities", "company environment", "office items", "supplies"]))
30+
.WithSteps(StepBuilder.Instance
31+
.AnswerUseKnowledge()
32+
.Build())
33+
.CreateAsync();
34+
35+
var result = await context
36+
.ProcessAsync("Hey! Where I can find some printer paper?");
37+
Console.WriteLine(result.Message.Content);;
38+
39+
}
40+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Examples.Utils;
2+
using MaIN.Core.Hub;
3+
using MaIN.Core.Hub.Utils;
4+
using MaIN.Domain.Entities;
5+
using MaIN.Domain.Entities.Agents.AgentSource;
6+
using Microsoft.Identity.Client;
7+
8+
namespace Examples.Agents;
9+
10+
public class AgentWithKnowledgeWebExample : IExample
11+
{
12+
public async Task Start()
13+
{
14+
Console.WriteLine("Piano Learning Assistant with Focused Knowledge Sources");
15+
16+
AIHub.Extensions.DisableLLamaLogs();
17+
var context = await AIHub.Agent()
18+
.WithModel("llama3.2:3b")
19+
.WithMemoryParams(new MemoryParams(){ContextSize = 2137})
20+
.WithInitialPrompt("""
21+
You are an expert piano instructor specializing in teaching specific pieces,
22+
techniques, and solving common playing problems. Help students learn exact
23+
fingerings, chord progressions, and troubleshoot technical issues with
24+
detailed, step-by-step guidance for both classical and popular music.
25+
""")
26+
.WithKnowledge(KnowledgeBuilder.Instance
27+
.AddUrl("piano_scales_major", "https://www.pianoscales.org/major.html",
28+
tags: ["scale_fingerings", "c_major_scale", "d_major_scale", "fingering_patterns"])
29+
.AddUrl("piano_chord_database", "https://www.pianochord.org/",
30+
tags: ["chord_fingerings", "cmaj7_chord", "chord_inversions", "left_hand_chords"])
31+
.AddUrl("fundamentals_practice_book", "https://fundamentals-of-piano-practice.readthedocs.io/",
32+
tags: ["memorization_techniques", "mental_play_method", "practice_efficiency", "difficult_passages"])
33+
.AddUrl("hanon_exercises", "https://www.hanon-online.com/",
34+
tags: ["hanon_exercises", "finger_independence", "daily_technical_work", "exercise_1_through_20"])
35+
.AddUrl("sheet_music_reading",
36+
"https://www.simplifyingtheory.com/how-to-read-sheet-music-for-beginners/",
37+
tags: ["bass_clef_reading", "treble_clef_notes", "note_identification", "staff_reading_speed"])
38+
.AddUrl("piano_fundamentals", "https://music2me.com/en/magazine/learn-piano-in-13-steps",
39+
tags: ["proper_posture", "finger_numbering", "hand_position", "keyboard_orientation"])
40+
.AddUrl("theory_lessons", "https://www.8notes.com/theory/",
41+
tags: ["interval_identification", "key_signatures", "circle_of_fifths", "time_signatures"])
42+
.AddUrl("piano_terms", "https://www.libertyparkmusic.com/musical-terms-learning-piano/",
43+
tags: ["dynamics_markings", "tempo_markings", "articulation_symbols", "expression_terms"]))
44+
.WithSteps(StepBuilder.Instance
45+
.AnswerUseKnowledge()
46+
.Build())
47+
.CreateAsync();
48+
49+
var result = await context
50+
.ProcessAsync("I want to learn the C major scale. What's the exact fingering pattern for both hands?" + "I want short and concrete answer");
51+
52+
Console.WriteLine(result.Message.Content);
53+
}
54+
}

Examples/Examples/Chat/ChatExample.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ public async Task Start()
88
{
99
Console.WriteLine("ChatExample is running!");
1010

11-
var context = AIHub.Chat().WithModel("gemma2:2b");
12-
13-
await context
11+
await AIHub.Chat()
12+
.WithModel("gemma2:2b")
1413
.WithMessage("Where do hedgehogs goes at night?")
1514
.CompleteAsync(interactive: true);
1615
}

Examples/Examples/Chat/ChatWithImageGenOpenAiExample.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Examples.Utils;
22
using MaIN.Core.Hub;
3+
using MaIN.Domain.Models;
34

45
namespace Examples;
56

@@ -12,6 +13,7 @@ public async Task Start()
1213

1314
var result = await AIHub.Chat()
1415
.EnableVisual()
16+
.WithModel("dall-e-3")
1517
.WithMessage("Generate rock style cow playing guitar")
1618
.CompleteAsync();
1719

Examples/Examples/Examples.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,17 @@
3737
<None Update="Files\Books.json">
3838
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3939
</None>
40+
<None Update="Files\Knowledge\events.md">
41+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
42+
</None>
43+
<None Update="Files\Knowledge\office_layout.md">
44+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
45+
</None>
46+
<None Update="Files\Knowledge\organization.md">
47+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
48+
</None>
49+
<None Update="Files\Knowledge\people.md">
50+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
51+
</None>
4052
</ItemGroup>
4153
</Project>
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# TechVibe Solutions - Events & Calendar
2+
3+
## Upcoming Company Events
4+
5+
### February 2025
6+
7+
#### Q1 All-Hands Meeting
8+
- **Date**: February 12, 2025
9+
- **Time**: 10:00 AM - 12:00 PM
10+
- **Location**: Main Conference Room (Floor 2)
11+
- **Presenter**: Sarah Chen (CEO)
12+
- **Agenda**: Q1 goals, product roadmap updates, team recognition
13+
- **RSVP**: Required by February 10th
14+
- **Catering**: Light refreshments provided
15+
16+
#### Engineering Tech Talk Series
17+
- **Date**: February 18, 2025
18+
- **Time**: 3:00 PM - 4:00 PM
19+
- **Location**: Engineering Hub (Floor 3)
20+
- **Topic**: "Microservices Architecture Best Practices"
21+
- **Presenter**: Alex Thompson
22+
- **Target Audience**: All engineering staff, open to other departments
23+
- **Format**: 45-minute presentation + Q&A
24+
25+
#### Client Success Workshop
26+
- **Date**: February 25, 2025
27+
- **Time**: 1:00 PM - 5:00 PM
28+
- **Location**: Training Room A (Floor 4)
29+
- **Target Audience**: Sales & Customer Success teams
30+
- **Topics**: Client retention strategies, upselling techniques
31+
- **Materials**: Workbooks and case studies provided
32+
33+
### March 2025
34+
35+
#### Professional Development Day
36+
- **Date**: March 5, 2025
37+
- **Time**: All day (9:00 AM - 5:00 PM)
38+
- **Location**: Various rooms throughout building
39+
- **Activities**:
40+
- Leadership training workshops
41+
- Technical skills sessions
42+
- Team building activities
43+
- Personal development seminars
44+
- **Registration**: Choose 3 sessions, register by February 28th
45+
46+
#### Company Quarterly Review
47+
- **Date**: March 15, 2025
48+
- **Time**: 2:00 PM - 4:00 PM
49+
- **Location**: Main Conference Room (Floor 2)
50+
- **Focus**: Q4 2024 results review, Q1 2025 progress update
51+
- **Presenters**: All department heads
52+
- **Format**: Financial review + department updates + Q&A
53+
54+
#### Customer Advisory Board Meeting
55+
- **Date**: March 22, 2025
56+
- **Time**: 9:00 AM - 3:00 PM
57+
- **Location**: Executive Conference Room (Floor 5)
58+
- **Attendees**: Key client representatives + executive team
59+
- **Agenda**: Product roadmap feedback, feature requests, strategic direction
60+
- **Catering**: Full lunch service provided
61+
62+
### April 2025
63+
64+
#### Annual Innovation Hackathon
65+
- **Dates**: April 10-11, 2025
66+
- **Time**: 9:00 AM (Apr 10) - 6:00 PM (Apr 11)
67+
- **Location**: Entire Floor 4
68+
- **Theme**: "AI-Powered Business Solutions"
69+
- **Teams**: 4-6 people per team, cross-departmental encouraged
70+
- **Prizes**:
71+
- 1st Place: $5,000 + implementation consideration
72+
- 2nd Place: $3,000 + recognition
73+
- 3rd Place: $1,000 + recognition
74+
- **Registration**: Teams register by April 1st
75+
76+
#### Spring Team Building Event
77+
- **Date**: April 28, 2025
78+
- **Time**: 12:00 PM - 8:00 PM
79+
- **Location**: Riverside Park & Conference Center
80+
- **Activities**:
81+
- Outdoor team challenges
82+
- BBQ lunch and dinner
83+
- Awards ceremony
84+
- Optional overnight camping
85+
- **Transportation**: Company buses provided
86+
- **RSVP**: Required by April 20th for catering
87+
88+
## Recurring Events
89+
90+
### Weekly Events
91+
92+
#### Monday Department Head Sync
93+
- **Time**: Every Monday, 9:00 AM - 9:30 AM
94+
- **Location**: Executive Conference Room (Floor 5)
95+
- **Attendees**: All department heads + CEO
96+
- **Purpose**: Weekly alignment, blockers, announcements
97+
98+
#### Wednesday Engineering Standup
99+
- **Time**: Every Wednesday, 9:30 AM - 10:00 AM
100+
- **Location**: Engineering Hub (Floor 3)
101+
- **Attendees**: All engineering staff
102+
- **Format**: Sprint updates, technical discussions, blockers
103+
104+
#### Friday Company Coffee Hour
105+
- **Time**: Every Friday, 3:30 PM - 4:30 PM
106+
- **Location**: Kitchen areas (all floors)
107+
- **Purpose**: Informal networking, cross-team interaction
108+
- **Refreshments**: Coffee, tea, light snacks provided
109+
110+
### Monthly Events
111+
112+
#### New Employee Orientation
113+
- **Schedule**: First Thursday of each month
114+
- **Time**: 10:00 AM - 3:00 PM
115+
- **Location**: Training Room B (Floor 4)
116+
- **Content**: Company overview, policies, benefits, system setup
117+
- **Presenter**: Rachel Brown (HR) + department representatives
118+
119+
#### Security Awareness Training
120+
- **Schedule**: Second Tuesday of each month
121+
- **Time**: 2:00 PM - 3:00 PM
122+
- **Location**: Various locations (rotating)
123+
- **Mandatory**: All employees must attend quarterly
124+
- **Topics**: Phishing, data protection, incident response
125+
- **Presenter**: James Wilson (Security)
126+
127+
#### Lunch & Learn Sessions
128+
- **Schedule**: Third Wednesday of each month
129+
- **Time**: 12:00 PM - 1:00 PM
130+
- **Location**: Main Conference Room (Floor 2)
131+
- **Format**: Guest speakers, skill sharing, industry trends
132+
- **Lunch**: Catered lunch provided
133+
- **Topics**: Rotating monthly themes
134+
135+
### Quarterly Events
136+
137+
#### Q1 (March): Performance Review Cycle
138+
- **Timeline**: Entire month of March
139+
- **Process**: Self-assessments, peer reviews, manager reviews
140+
- **Locations**: Individual offices + meeting rooms
141+
- **HR Support**: Available for questions and guidance
142+
143+
#### Q2 (June): Mid-year Strategic Planning
144+
- **Dates**: Usually second week of June
145+
- **Duration**: 2-day offsite retreat
146+
- **Location**: Offsite conference center
147+
- **Participants**: Leadership team + selected staff
148+
- **Focus**: Strategy adjustment, goal setting for H2
149+
150+
#### Q3 (September): Annual Budget Planning
151+
- **Timeline**: Throughout September
152+
- **Process**: Department budget requests, reviews, approvals
153+
- **Key Dates**:
154+
- Sep 1: Budget templates released
155+
- Sep 15: Department submissions due
156+
- Sep 30: Final budgets approved
157+
158+
#### Q4 (December): Holiday Celebration
159+
- **Date**: Usually mid-December
160+
- **Time**: 6:00 PM - 10:00 PM
161+
- **Location**: Rented event venue
162+
- **Activities**: Dinner, awards, entertainment, gift exchange
163+
- **Plus-ones**: Spouses/partners invited
164+
165+
## Meeting Room Booking & Procedures
166+
167+
### Booking System
168+
- **Platform**: Outlook calendar integration
169+
- **Advance booking**: Up to 3 months in advance
170+
- **Maximum duration**: 4 hours per booking
171+
- **Buffer time**: 15 minutes required between meetings
172+
- **Cancellation policy**: 24 hours advance notice required
173+
174+
### Room Capacities & Equipment
175+
- **Main Conference Room (201)**: 24 people, full AV setup
176+
- **Executive Conference Room (504)**: 12 people, premium AV
177+
- **Training Rooms A & B**: 20 and 12 people respectively
178+
- **Small Meeting Rooms (202-206)**: 4-6 people each
179+
- **Phone Booths**: 1-2 people, quick calls
180+
181+
### Catering Procedures
182+
183+
#### Internal Events
184+
- **Contact**: Jennifer Lee (Executive Assistant)
185+
- **Email**: j.lee@techvibe.com
186+
- **Lead time**: 48 hours minimum
187+
- **Budget approval**: Required for >20 people
188+
189+
#### External Client Meetings
190+
- **Contact**: Robert Johnson (Facilities Manager)
191+
- **Email**: r.johnson@techvibe.com
192+
- **Lead time**: 72 hours minimum
193+
- **Special dietary needs**: Always accommodated
194+
195+
#### Approved Catering Vendors
196+
- **Daily lunch**: Fresh Bites Catering
197+
- **Special events**: Gourmet Affairs
198+
- **Coffee service**: Local Roasters Co.
199+
- **Dietary restrictions**: All vendors accommodate allergies/preferences
200+
201+
## Holiday Schedule 2025
202+
203+
### Company Holidays (Offices Closed)
204+
- **New Year's Day**: January 1
205+
- **Martin Luther King Jr. Day**: January 20
206+
- **Presidents Day**: February 17
207+
- **Memorial Day**: May 26
208+
- **Independence Day**: July 4
209+
- **Labor Day**: September 1
210+
- **Indigenous Peoples Day**: October 13
211+
- **Veterans Day**: November 11
212+
- **Thanksgiving**: November 27-28
213+
- **Christmas Eve**: December 24
214+
- **Christmas Day**: December 25
215+
- **New Year's Eve**: December 31
216+
217+
### Floating Holidays
218+
- **Allocation**: 2 floating holidays per employee
219+
- **Usage**: Any time with manager approval
220+
- **Carryover**: Does not roll over to next year
221+
- **Popular choices**: Cultural/religious holidays, birthday, personal days

0 commit comments

Comments
 (0)